Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2145,10 +2145,11 @@ class LogisticRegressionSuite extends MLTest with DefaultReadWriteTest {
test("multinomial logistic regression with intercept with elasticnet regularization") {
val trainer1 = (new LogisticRegression).setFitIntercept(true).setWeightCol("weight")
.setElasticNetParam(0.5).setRegParam(0.1).setStandardization(true)
.setMaxIter(300).setTol(1e-10)
.setMaxIter(220).setTol(1e-10)

val trainer2 = (new LogisticRegression).setFitIntercept(true).setWeightCol("weight")
.setElasticNetParam(0.5).setRegParam(0.1).setStandardization(false)
.setMaxIter(300).setTol(1e-10)
.setMaxIter(90).setTol(1e-10)

val model1 = trainer1.fit(multinomialDataset)
val model2 = trainer2.fit(multinomialDataset)
Expand Down Expand Up @@ -2234,8 +2235,8 @@ class LogisticRegressionSuite extends MLTest with DefaultReadWriteTest {
0.0, 0.0, 0.0, 0.0), isTransposed = true)
val interceptsR = Vectors.dense(-0.38857157, 0.62492165, -0.2363501)

assert(model1.coefficientMatrix ~== coefficientsRStd absTol 0.01)
assert(model1.interceptVector ~== interceptsRStd absTol 0.01)
assert(model1.coefficientMatrix ~== coefficientsRStd absTol 0.05)
assert(model1.interceptVector ~== interceptsRStd absTol 0.1)
assert(model1.interceptVector.toArray.sum ~== 0.0 absTol eps)
assert(model2.coefficientMatrix ~== coefficientsR absTol 0.01)
assert(model2.interceptVector ~== interceptsR absTol 0.01)
Expand Down