mlr3超参数Hyperparameter 自动寻找auto

底层还是根据你本来在R跑单独那一个机器学习的函数,例如randomForest::randomForest(),里面可以填入什么,然后跟你的实际数据取值范围去设个范围。然后用auto_tuner()函数对学习器的超参数自动调参

随机森林randomforest

learner_rf <- lrn("classif.ranger",
                  mtry=to_tune(2,15),
                  min.node.size = to_tune(1,10),
                  num.trees = to_tune(50,1000),
                  splitrule = "gini",
                  importance = "impurity",
                  predict_type = "prob")

xgboost

learner_xgb = lrn(
  "classif.xgboost",
  eta               = to_tune(1e-4, 1),
  nrounds           = to_tune(1, 5000),
  max_depth         = to_tune(1, 20),
  colsample_bytree  = to_tune(1e-1, 1),
  colsample_bylevel = to_tune(1e-1, 1),
  lambda            = to_tune(1e-3, 1e3, logscale = TRUE),
  alpha             = to_tune(1e-3, 1e3, logscale = TRUE),
  subsample         = to_tune(1e-1, 1),
  predict_type = "prob",
  verbose = 0
)

支持向量机 SVM

learner_SVM <- lrn("classif.svm", type = "C-classification", kernel = "radial",
                   cost = to_tune(0.1, 10),predict_type="prob",
                   gamma = to_tune(0, 5))
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值