Change the threshold of a
Prediction during the
$predict_type needs to be
R6Class inheriting from
PipeOpThreshold$new(id = "threshold", param_vals = list())
Identifier of the resulting object, default
param_vals :: named
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction. Defaults to
During training, the input and output are
PredictionClassif is required as input and returned as output during prediction.
$state is left empty (
A numeric vector of thresholds for the different class levels. May have length 1 for binary classification predictions, must otherwise have length of the number of target classes; see
0.5, i.e. thresholding for binary classification
Only fields inherited from
Only methods inherited from
library("mlr3") t = tsk("german_credit") gr = po(lrn("classif.rpart", predict_type = "prob")) %>>% po("threshold", param_vals = list(thresholds = 0.9)) gr$train(t) gr$predict(t)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.