Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-6496] [MLLIB] GeneralizedLinearAlgorithm.run(input, initialWeights) should initialize numFeatures #5167

Closed
wants to merge 1 commit into from

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.

@@ -211,6 +211,10 @@ abstract class GeneralizedLinearAlgorithm[M <: GeneralizedLinearModel]
*/
def run(input: RDD[LabeledPoint], initialWeights: Vector): M = {

if (numFeatures < 0) {
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