-
- Downloads
[SPARK-6496] [MLLIB] GeneralizedLinearAlgorithm.run(input, initialWeights)...
[SPARK-6496] [MLLIB] GeneralizedLinearAlgorithm.run(input, initialWeights) should initialize numFeatures In GeneralizedLinearAlgorithm ```numFeatures``` is default to -1, we need to update it to correct value when we call run() to train a model. ```LogisticRegressionWithLBFGS.run(input)``` works well, but when we call ```LogisticRegressionWithLBFGS.run(input, initialWeights)``` to train multiclass classification model, it will throw exception due to the numFeatures is not updated. In this PR, we just update numFeatures at the beginning of GeneralizedLinearAlgorithm.run(input, initialWeights) and add test case. Author: Yanbo Liang <ybliang8@gmail.com> Closes #5167 from yanboliang/spark-6496 and squashes the following commits: 8131c48 [Yanbo Liang] LogisticRegressionWithLBFGS.run(input, initialWeights) should initialize numFeatures
Showing
- mllib/src/main/scala/org/apache/spark/mllib/regression/GeneralizedLinearAlgorithm.scala 4 additions, 0 deletions...e/spark/mllib/regression/GeneralizedLinearAlgorithm.scala
- mllib/src/test/scala/org/apache/spark/mllib/classification/LogisticRegressionSuite.scala 6 additions, 0 deletions.../spark/mllib/classification/LogisticRegressionSuite.scala
Loading
Please register or sign in to comment