Skip to contents

Base class for training/running a machine learning model

Usage

mlr_report

# S3 method for class 'mlr_report'
read(mlr_report, ...)

# S3 method for class 'mlr_report'
process(mlr_report, train = TRUE, predict = TRUE, ...)

train(...)

predict(...)

# S3 method for class 'mlr_report'
output(mlr_report, ...)

# S3 method for class 'mlr_report'
write(mlr_report, subdir = class(mlr_report)[1], sync = TRUE, ...)

load_model(subdir = "model", model_name = "model.Rds")

save_model(model, subdir = "model", model_name = "model.Rds", sync = TRUE)

Format

An object of class mlr_report (inherits from report, list) of length 0.

Arguments

mlr_report

The report object

...

not used

train

boolean whether to run the training

predict

boolean whether to run the predictions

subdir

character(1) location where the model is stored

sync

boolean whether to sync data across storages

model_name

character(1) filename of the model

model

mlr3::Learner to be saved

Methods (by generic)

  • read(mlr_report): Should load the dataset into mlr_report$task and is in charge of labeling column roles (i.e. feature, target, group, weight)

  • process(mlr_report): Do the training and/or run the model. Subclasses should define a train.mlr_model and predict.mlr_model function, which should load from mlr_report$task and store their results in mlr_report$model and mlr_report$predictions

  • output(mlr_report): Analyze the input set and the sensitivity of the training using some standard heuristics.

  • write(mlr_report): Save the trained model and model output for future use. Writes the model to the tessilake::cache_primary_path under the subdirectory subdir and then syncs them across storages.

Functions

  • train(): Train the model

  • predict(): Predict the model

  • load_model(): load serialized mlr model from disk

  • save_model(): save serialized mlr model to disk