【问题标题】:h2o model not subscriptableh2o 模型不可下标
【发布时间】:2018-06-24 11:14:24
【问题描述】:

我认为一个相当简单的问题 - 我想了解如何从我用 python 构建的 h2o 模型中提取各种元数据?

在 R 中,我可以运行以下命令来获取此类信息。

my_h2o_model@algorithm
my_h2o_model@parameters

my_performance = h2o.performance(my_h2o_model)
my_performance@metrics$thresholds_and_metric_scores # awesome see all classifier metrics at each threshold

如果我尝试在 python 中

my_h2o_model['algorithm'] 

my_h2o_model[0]

perf=model_performance(my_h2o_model)
perf['metrics']['thresholds_and_metric_scores] # !!!!

TypeError: 'H2OGradientBoostingEstimator' 对象不可下标

如何从 python 中的模型中获取这些信息??

【问题讨论】:

    标签: python h2o


    【解决方案1】:

    您打错字了——thresholds_and_metric_scores 后面少了一个单引号。

    perf['metrics']['thresholds_and_metric_scores']
    

    【讨论】:

    • 使用 dir() 函数解决了这个问题,但是是的 - 谢谢
    【解决方案2】:

    使用 dir() 找到我需要的各种函数。

    【讨论】:

      猜你喜欢
      • 2020-01-04
      • 2019-03-03
      • 2021-06-24
      • 2019-08-08
      • 1970-01-01
      • 2020-10-27
      • 1970-01-01
      • 2017-08-23
      • 2018-08-12
      相关资源
      最近更新 更多