本文介绍了MLR随机森林多标签获得功能重要性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用mlr包中的multilabel.randomForestSRC学习器来解决多标签分类问题 我想返回变量的重要性

I am using multilabel.randomForestSRC learner from mlr package for a multi-label classification problem I would like to return the variables importances

getFeatureImportance函数返回此问题:

The getFeatureImportance function return this issue :

代码:

getFeatureImportance(mod)

错误:

Error in checkLearner(object$learner, props = "featimp") :
Learner 'multilabel.randomForestSRC' must support properties 'featimp', but does not support featimp'

推荐答案

您可以通过此处:

library(mlr)
yeast = getTaskData(yeast.task)
labels = colnames(yeast)[1:14]
yeast.task = makeMultilabelTask(id = "multi", data = yeast, target = labels)
lrn.rfsrc = makeLearner("multilabel.randomForestSRC")
mod2 = train(lrn.rfsrc, yeast.task)

vi =randomForestSRC::vimp(mod2$learner.model)
plot(vi,m.target ="label2")

这篇关于MLR随机森林多标签获得功能重要性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 13:29