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)
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 intomlr_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 atrain.mlr_model
andpredict.mlr_model
function, which should load frommlr_report$task
and store their results inmlr_report$model
andmlr_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 subdirectorysubdir
and then syncs them across storages.