Skip to content

Conversation

@yanboliang
Copy link
Contributor

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.

@yanboliang yanboliang changed the title LogisticRegressionWithLBFGS.run(input, initialWeights) should initialize numFeatures [SPARK-6496] [MLLIB] LogisticRegressionWithLBFGS.run(input, initialWeights) should initialize numFeatures Mar 24, 2015
@SparkQA
Copy link

SparkQA commented Mar 24, 2015

Test build #29084 has started for PR 5167 at commit 8131c48.

  • This patch merges cleanly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! I get it now. This check is only carried out in one of the two run() methods. LGTM.

@yanboliang yanboliang changed the title [SPARK-6496] [MLLIB] LogisticRegressionWithLBFGS.run(input, initialWeights) should initialize numFeatures [SPARK-6496] [MLLIB] GeneralizedLinearAlgorithm.run(input, initialWeights) should initialize numFeatures Mar 24, 2015
@SparkQA
Copy link

SparkQA commented Mar 24, 2015

Test build #29084 has finished for PR 5167 at commit 8131c48.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/29084/
Test PASSed.

asfgit pushed a commit that referenced this pull request Mar 25, 2015
…ghts) 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 <[email protected]>

Closes #5167 from yanboliang/spark-6496 and squashes the following commits:

8131c48 [Yanbo Liang] LogisticRegressionWithLBFGS.run(input, initialWeights) should initialize numFeatures

(cherry picked from commit 10c7860)
Signed-off-by: Sean Owen <[email protected]>
@asfgit asfgit closed this in 10c7860 Mar 25, 2015
@yanboliang yanboliang deleted the spark-6496 branch April 24, 2015 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants