【问题标题】:take mse from h2o performance and save it in a variable.从 h2o 性能中获取 mse 并将其保存在变量中。
【发布时间】:2016-03-06 12:58:21
【问题描述】:

我有一个 h2o(R) 模型。它的性能产生

h2o.performance(models[[1]],valid=T)

给出输出

H2ORegressionMetrics: deeplearning
** Reported on validation data. **
Description: Metrics reported on temporary validation frame with 9724 samples

MSE:  1.18963
R2 :  0.07689513
Mean Residual Deviance :  1.18963

我想获取 MSE 并将其保存在变量中。我尝试使用

生成混淆矩阵
 h2o.confusionMatrix(h2o.performance(models[[i]],valid=T))

但它会生成 NULL。

【问题讨论】:

    标签: r machine-learning h2o


    【解决方案1】:

    获取均方误差

    要获取均方误差 (MSE) 值,您可以使用 h2o.mse() 函数,如下例所示(Aiello, Kraljevic, & Maj, 2015):

    perf <- h2o.performance(model = your_data_file.gbm, data = your_data_file.hex)
    your_new_variable <- h2o.mse(perf)
    

    示例结果

    > h2o.performance(model = your_data_file.gbm, data = your_data_file.hex)
    H2OBinomialMetrics: gbm
    ** Reported on training data. **
    
    MSE:  0.07584147
    R^2:  0.6846763
    LogLoss:  0.2744668
    AUC:  0.9780312
    Gini:  0.9560623
    
    > perf <- h2o.performance(model = your_data_file.gbm, data = your_data_file.hex)
    > your_new_variable <- h2o.mse(perf)
    > your_new_variable
    [1] 0.07584147
    

    关于混淆矩阵

    此外,混淆矩阵中的 NULL 值可能表明您的 h2o.performance() 函数本身不包含或返回混淆矩阵。


    参考文献

    Aiello, S.、Kraljevic, T. 和 Maj, P.(2015 年 11 月 24 日)。包'h2o'。检索于 2015 年 12 月 2 日,来自 https://cran.r-project.org/web/packages/h2o/h2o.pdf

    【讨论】:

      猜你喜欢
      • 2021-01-12
      • 2016-08-24
      • 2016-10-19
      • 2021-04-17
      • 2013-09-27
      • 1970-01-01
      • 2014-10-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多