Featureless torch learner. Output is a constant weight that is learned during training. For classification, this should (asymptoptically) result in a majority class prediction when using the standard cross-entropy loss. For regression, this should result in the median for L1 loss and in the mean for L2 loss.
Dictionary
This Learner can be instantiated using the sugar function lrn():
# Define the Learner and set parameter valueslearner = lrn("classif.torch_featureless")learner$param_set$set_values( epochs =1, batch_size =16, device ="cpu")# Define a Tasktask = tsk("iris")# Create train and test setids = partition(task)# Train the learner on the training idslearner$train(task, row_ids = ids$train)# Make predictions for the test rowspredictions = learner$predict(task, row_ids = ids$test)# Score the predictionspredictions$score()
See Also
Other Learner: mlr_learners.mlp, mlr_learners.tab_resnet, mlr_learners_torch, mlr_learners_torch_image, mlr_learners_torch_model