How to calculate p-values in Spark's Logistic Regression?

梦想与她 提交于 2019-12-07 15:03:58

问题


We are using LogisticRegressionWithSGD and would like to figure out which of our variables predict and with what significance. Some stats packages (StatsModels) return p-values for each term. A low p-value (< 0.05) indicates a meaningful addition to the model.

How can we get/calculate p-values from LogisticRegressionWithSGD model?

Any help with this is appreciated.


回答1:


This is a very old question, but some guidance for people coming to it late might be valuable.

LogisticRegressionWithSGD is deprecated. In that version, no true set of "summary" information was provided with the model itself. If you cannot get access to an up-to-date version of pyspark, you will have to calculate the P-values for each of your features yourself. Here is a nice intro to doing that by "hand".

If you can get the current version of pyspark, then you will want to use: pyspark.mllib.classification.LogisticRegressionWithLBFGS (docs here)



来源:https://stackoverflow.com/questions/36944121/how-to-calculate-p-values-in-sparks-logistic-regression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!