【问题标题】:is p-value deprecated in h2o glm在 h2o glm 中不推荐使用 p 值
【发布时间】:2017-07-23 08:39:26
【问题描述】:

在 elasticnet 中是否不推荐使用 p 值?下面的参考资料显示了系数中的 p 值 http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/glm.html

但是当我执行下面的命令时我没有看到 p 值

 head(elastic_net_best_model@model$coefficients_table)
 Coefficients: glm coefficients

              names  coefficients standardized_coefficients

【问题讨论】:

    标签: r h2o


    【解决方案1】:

    只有在 compute_p_values 设置为 true 时才会计算 p 值,并且这也只有在没有正则化时才有效,这需要 lambda=0

    举个例子,

    library(h2o)
    h2o.init()
    x<-as.h2o(iris)
    xg<-h2o.glm(y="Sepal.Length",training_frame=x,compute_p_values=TRUE,lambda=0)
    head(xg@model$coefficients_table)
    

    这给出了输出:

    Coefficients: glm coefficients
                   names coefficients std_error   z_value  p_value standardized_coefficients
    1          Intercept     2.171266  0.279794  7.760227 0.000000                  6.425687
    2 Species.versicolor    -0.723562  0.240169 -3.012721 0.003060                 -0.723562
    3  Species.virginica    -1.023498  0.333726 -3.066878 0.002584                 -1.023498
    4        Sepal.Width     0.495889  0.086070  5.761466 0.000000                  0.216141
    5       Petal.Length     0.829244  0.068528 12.100867 0.000000                  1.463863
    6        Petal.Width    -0.315155  0.151196 -2.084418 0.038888                 -0.240223
    

    【讨论】:

      猜你喜欢
      • 2018-09-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-13
      • 1970-01-01
      • 2016-04-22
      • 2012-11-14
      • 2015-08-25
      相关资源
      最近更新 更多