set_pred {modelenv}R Documentation

Register Prediction Method for Model

Description

This function is used to register prediction method information for a model, mode, and engine combination.

Usage

set_pred(model, mode, eng, type, value)

get_pred_type(model, type)

Arguments

model

A single character string for the model type (e.g. "k_means", etc).

mode

A single character string for the model mode (e.g. "partition").

eng

A single character string for the model engine.

type

A single character value for the type of prediction. Possible values are: cluster and raw.

value

A list of values, described in the Details.

Details

The list passed to value needs the following values:

Value

A tibble

Examples


set_new_model("shallow_learning_model")
set_model_mode("shallow_learning_model", "partition")
set_model_engine("shallow_learning_model", "partition", "stats")

set_pred(
  model = "shallow_learning_model",
  eng = "stats",
  mode = "partition",
  type = "cluster",
  value = list(
    pre = NULL,
    post = NULL,
    func = c(fun = "predict"),
    args =
      list(
        object = rlang::expr(object$fit),
        newdata = rlang::expr(new_data),
        type = "response"
      )
  )
)

get_pred_type("shallow_learning_model", "cluster")
get_pred_type("shallow_learning_model", "cluster")$value


[Package modelenv version 0.1.1 Index]