简体   繁体   English

H2O 错误:“没有名称“领导者”的插槽

[英]Error with H2O: "no slot of name "leader"

I am getting the following error, after trying to get most important variables with H2o Package in a classification binary problem with Rstudio.在 Rstudio 的分类二进制问题中尝试使用 H2o Package 获取最重要的变量后,出现以下错误。

Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'h2o.varimp': no slot of name "leader" for this object of class "H2OBinomialModel" h(simpleError(msg,call))中的错误:在为 function 'h2o.varimp' 选择方法时评估参数 'object' 时出错:class“H2OBinomialModel”的这个 object 没有名称“leader”的插槽

Previous Error comes after applying the following steps.应用以下步骤后出现上一个错误。

# 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)

And then last code produces this error.然后最后一个代码产生这个错误。

Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'h2o.varimp': no slot of name "leader" for this object of class "H2OBinomialModel" h(simpleError(msg,call))中的错误:在为 function 'h2o.varimp' 选择方法时评估参数 'object' 时出错:class“H2OBinomialModel”的这个 object 没有名称“leader”的插槽

The h2o.varimp(rautoml_winner@leader) makes no sense since the rautoml_winner is already the leader model (= the best model according to the sort metric from the automl). h2o.varimp(rautoml_winner@leader)没有意义,因为rautoml_winner已经是领导者 model(= 根据 automl 的排序指标的最佳 model)。 Removing the @leader would fix it for all models except for the Stacked Ensembles which do not have variable importance calculated during training.删除@leader将为所有模型修复它,但 Stacked Ensembles 除外,它在训练期间没有计算变量重要性。

You can still get variable importance for Stacked Ensembles using the permutation variable importance, eg, h2o.permutation_importance(rautoml_winner, test_h2o) .您仍然可以使用排列变量重要性(例如h2o.permutation_importance(rautoml_winner, test_h2o)获得堆叠集成的可变重要性。 See the documentation for more information.有关详细信息,请参阅文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM