# NOT RUN {
task = tsk("iris")
learner = lrn("classif.rpart", predict_type = "prob")
learner$train(task)
p = learner$predict(task)
p$predict_types
head(as.data.table(p))
# confusion matrix
p$confusion
# change threshold
th = c(0.05, 0.9, 0.05)
names(th) = task$class_names
# new predictions
p$set_threshold(th)$response
p$score(measures = msr("classif.ce"))
# }
Run the code above in your browser using DataLab