coefficients of logistic regression have no attribute indices in pyspark

╄→尐↘猪︶ㄣ 提交于 2019-12-11 18:31:12

问题


I wrote this code and the coefficients are not available as a sparse vector so I can't extract the indices in order to identify the active entries of the model.

lr = LogisticRegression(elasticNetParam = 1.0, featuresCol = "features", 
labelCol = target_var)
lasso_model = lr.fit(training_full)
## Extract variables with coefficients !=0 (sparse vector) + sorting
coeff = lasso_model.coefficients
coeff.indices

来源:https://stackoverflow.com/questions/55143818/coefficients-of-logistic-regression-have-no-attribute-indices-in-pyspark

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