代码之家  ›  专栏  ›  技术社区  ›  runningbirds

水模型不可订阅

  •  0
  • runningbirds  · 技术社区  · 6 年前

    我认为这个问题很简单——我想了解如何从我用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中的模型中获取这些信息??

    2 回复  |  直到 6 年前
        1
  •  1
  •   Erin LeDell    6 年前

    你有一个错别字--你在后面少了一个引号 thresholds_and_metric_scores .

    perf['metrics']['thresholds_and_metric_scores']
    
        2
  •  0
  •   runningbirds    6 年前

    使用dir()查找所需的各种函数。