Logistic回归系数在pyspark中没有属性索引

时间:2019-03-13 14:05:19

标签: pyspark sparse-matrix logistic-regression

我编写了这段代码,并且系数不作为稀疏向量提供,因此我无法提取索引来标识的有效条目 模型。

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

0 个答案:

没有答案