问题
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