是否在h2o glm中弃用了p值

时间:2017-07-22 20:34:36

标签: r h2o

在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

1 个答案:

答案 0 :(得分:3)

只有在compute_p_values设置为true时才会计算p值,并且只有在没有正则化时才会计算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