r语言 - H2O 错误:"没有名称"领导者"的插槽



我得到以下错误,试图得到H2o包在分类二进制问题与Rstudio的最重要的变量。

Error in h(simpleError(msg, call)):在为函数'h2o '选择方法时计算参数'object'时出错。Varimp:没有名字"领导"对于这个类"H2OBinomialModel"对象

应用以下步骤后出现先前错误。

# Lookup best Algorithm for this classification challenge (binary).
rautoml<- h2o.automl(y = target,x = independientes,
training_frame = train_h2o,
validation_frame = test_h2o,  # Podría probar hacer el test contra el futuro.
nfolds = 3,
max_runtime_secs = 300,
sort_metric = 'AUC'
)
#Get the best model from previous step
rautoml_winner <- rautoml@leader
###### Winner model is a StackedEnsemble_AllModels####
#Get the most important variables.
h2o.varimp(rautoml_winner@leader)

最后一段代码产生这个错误。

Error in h(simpleError(msg, call)):在为函数'h2o '选择方法时计算参数'object'时出错。Varimp:没有名字"领导"对于这个类"H2OBinomialModel"对象

h2o.varimp(rautoml_winner@leader)没有意义,因为rautoml_winner已经是leader模型(=根据automl的排序度量的最佳模型)。移除@leader将修复所有模型,除了在训练过程中没有计算变量重要性的堆叠集成。

您仍然可以使用排列变量重要性获得堆叠集成的变量重要性,例如h2o.permutation_importance(rautoml_winner, test_h2o)。查看文档获取更多信息。

相关内容

最新更新