代码
library(mlr3verse)
# 创建任务
= tsk("german_credit")
tsk_german_credit # 选择学习器
= lrn("classif.ranger",predict_type = "prob")
lrn_ranger # 划分训练集测试集
<- partition(tsk_german_credit, ratio = 0.6, stratify = T)
split $train(tsk_german_credit, row_ids = split$train)
lrn_ranger<- lrn_ranger$predict(tsk_german_credit, row_ids = split$test) prediction