【问题标题】:How to get mlr3 importance scores from learner?如何从学习者那里获得 mlr3 重要性分数?
【发布时间】:2021-08-06 17:10:49
【问题描述】:

如何获得重要性分数?我试过这个:

task = tsk("iris")
search_space = ParamSet$new(
  params = list(
  ParamDbl$new(id = "eta", lower = 0.2, upper = .4)))

at = AutoTuner$new(
  learner = lrn("classif.xgboost"),
  resampling = rsmp("holdout"),
  measure = msr("classif.ce"),
  terminator = trm("evals", n_evals = 2),
  tuner = tnr("grid_search"),
  search_space = search_space,
  store_tuning_instance = TRUE)

at$train(task)
at$importance
at$importance()

但它似乎不起作用。

【问题讨论】:

    标签: mlr3


    【解决方案1】:

    你需要从学习者那里得到重要性,而不是调谐器:

    > at$learner$importance()
     Petal.Width Petal.Length 
       0.5028937    0.4971063
    

    【讨论】:

    • 使用GraphLearner 时,stackoverflow.com/questions/66267945/… 可能会有所帮助。
    • 另请注意,mlr3 团队正在努力通过为 AutoTunerGraphLearner 实现 $importance() 来简化此操作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-21
    • 1970-01-01
    • 2022-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多