# NOT RUN {
# get all classification learners from mlr_learners:
lrns = mlr_learners$mget(mlr_learners$keys("^classif"))
names(lrns)
# get a specific learner from mlr_learners:
lrn = lrn("classif.rpart")
print(lrn)
# train the learner:
task = tsk("iris")
lrn$train(task, 1:120)
# predict on new observations:
lrn$predict(task, 121:150)$confusion
# }
Run the code above in your browser using DataLab