spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michelleyang <michelle1026sh...@gmail.com>
Subject ML:One vs Rest with crossValidator for multinomial in logistic regression
Date Tue, 30 Jan 2018 14:55:01 GMT
I tried to use One vs Rest in spark ml with pipeline and crossValidator for
multimultinomial in logistic regression.

It came out with empty coefficients. I figured out it was the setting of
ParamGridBuilder. Can anyone help me understand how does the parameter
setting affect the crossValidator process?

the orginal code: //output empty coefficients.

val logist=new LogisticRegression

val ova = new OneVsRest().setClassifier(logist)

val paramMaps = new ParamGridBuilder().addGrid(ova.classifier,
Array(logist.getRegParam))

New code://output multi classes coefficients

val logist=new LogisticRegression

val ova = new OneVsRest().setClassifier(logist)

val classifier1 = new LogisticRegression().setRegParam(2.0)

val classifier2 = new LogisticRegression().setRegParam(3.0)

val paramMaps = new ParamGridBuilder() .addGrid(ova.classifier,
Array(classifier1, classifier2))

Please help!!!! Thanks.



--
Sent from: http://apache-spark-user-list.1001560.n3.nabble.com/

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org


Mime
View raw message