在scikit-learn-in-python中,logistic回归有一个c参数(正则化参数)。现在,我想知道pyspark的等价物是什么?当我在spark mllib中进行logistic回归时,得到以下错误:
lr = LogisticRegression(labelCol="label", featuresCol="features", maxIter=10)
paramGrid = (ParamGridBuilder()
.addGrid(lr.regParam,[0.001, 0.01, 0.01, 1, 10, 100, 1000])
.addGrid(lr.elasticNetParam, [0.0, 0.1, 0.5, 0.8, 1])
.addGrid(lr.C, [0.001, 0.01, 0.01, 1, 10, 100, 1000])
.build())
我得到的错误是:
AttributeError: 'LogisticRegression' object has no attribute 'C'
以下代码:
crossval = CrossValidator(estimator=lr,
estimatorParamMaps=paramGrid,
evaluator=BinaryClassificationEvaluator(),
numFolds=5)
cvModel=crossval.fit(train_df)
你能帮帮我吗?致以最诚挚的问候
暂无答案!
目前还没有任何答案,快来回答吧!