Skip to content

Conversation

@wangmiao1981
Copy link
Contributor

What changes were proposed in this pull request?

PR #17715 Added Constrained Logistic Regression for ML. We should add it to SparkR.

How was this patch tested?

Add new unit tests.

@SparkQA
Copy link

SparkQA commented May 27, 2017

Test build #77455 has finished for PR 18128 at commit 7627ac9.

  • This patch fails R style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 27, 2017

Test build #77456 has finished for PR 18128 at commit 9d302c4.

  • This patch fails R style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 27, 2017

Test build #77457 has finished for PR 18128 at commit 6a5b568.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 27, 2017

Test build #77462 has finished for PR 18128 at commit 354eeb3.

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

@felixcheung
Copy link
Member

@yanboliang

Copy link
Member

Choose a reason for hiding this comment

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

could you add some check for upperBoundsOnCoefficients or lowerBoundsOnCoefficients
for example, if upperBoundsOnCoefficients is a vector instead of a matrix, ncol(as.array(upperBoundsOnCoefficients)) will be NA

@SparkQA
Copy link

SparkQA commented May 29, 2017

Test build #77495 has finished for PR 18128 at commit 8094b8d.

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

@wangmiao1981
Copy link
Contributor Author

@yanboliang Can you take a look? Thanks!

@SparkQA
Copy link

SparkQA commented May 31, 2017

Test build #77607 has finished for PR 18128 at commit 4c7b97c.

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

@yanboliang
Copy link
Contributor

@wangmiao1981 Will review soon. Thanks.

Copy link
Contributor

@yanboliang yanboliang Jun 2, 2017

Choose a reason for hiding this comment

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

Here we can merge the four parameters into two: nrow and ncol, since the matrix format of lowerBoundsOnCoefficients and upperBoundsOnCoefficients should be consistent. If the input doesn't confirm with this rule, we need to throw exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Question: Based on my understanding, lowerBoundsOnCoefficients and upperBoundsOnCoefficients are not required to set at the same time. They can be set at the same time.
For the first case, we can't enforce the dimension of the two matrices because one could be NULL.
For the second case, we can check it.

So, we can't enforce the rule in general.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I think I can do the check because I have a NULL check before enforcing the rule.

Copy link
Contributor

Choose a reason for hiding this comment

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

See my comment above, we can merge the four parameters into two: numRowsOfBoundsOnCoefficients and numColsOfBoundsOnCoefficients, please follow Scala naming convention.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add test for multinomial logistic regression? I think only test one side bound is enough.

@SparkQA
Copy link

SparkQA commented Jun 2, 2017

Test build #77691 has finished for PR 18128 at commit c304ba8.

  • This patch fails R style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2017

Test build #77695 has finished for PR 18128 at commit 47fbccc.

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

Copy link
Member

Choose a reason for hiding this comment

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

paste would insert space - use paste0 instead or just remove the space in the string to let it to add it

Copy link
Member

Choose a reason for hiding this comment

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

nit: no need to as.integer(row) and as.integer(col) since they are set internally and not a parameter

Copy link
Member

Choose a reason for hiding this comment

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

given how this is used later in scala code, should there be a check that nrow(upper) == nrow(lower) and ditto for ncol(upper) == ncol(lower)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the case where we only set the upperbound. We can set both or either one of them.

For the case that both are set. We enforce upperbound and lowerbound are the same dimension, as checked above.

Copy link
Member

Choose a reason for hiding this comment

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

ok thanks, L290-291

@SparkQA
Copy link

SparkQA commented Jun 3, 2017

Test build #77699 has finished for PR 18128 at commit b89a0f7.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangmiao1981
Copy link
Contributor Author

Jenkins retest this please

@SparkQA
Copy link

SparkQA commented Jun 3, 2017

Test build #77703 has finished for PR 18128 at commit b89a0f7.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangmiao1981
Copy link
Contributor Author

Local test passed. Let me check it tonight.

@wangmiao1981
Copy link
Contributor Author

@felixcheung if I remove as.integer, backend doesn't recognize it as integer.

@SparkQA
Copy link

SparkQA commented Jun 4, 2017

Test build #77706 has finished for PR 18128 at commit 2a7e6e3.

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

@felixcheung
Copy link
Member

ok, thanks, i guess it could be set as 0L but this is good.

@SparkQA
Copy link

SparkQA commented Jun 12, 2017

Test build #77909 has finished for PR 18128 at commit c3190b5.

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

@wangmiao1981
Copy link
Contributor Author

ping @yanboliang

@yanboliang
Copy link
Contributor

@wangmiao1981 I'm at DataWorks Summit today and tomorrow, will take a look by this Friday. Thanks.

Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

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

minor comment, LGTM otherwise

Copy link
Member

Choose a reason for hiding this comment

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

size must be equal with 1 - should this be size must be equal to 1?

Copy link
Member

Choose a reason for hiding this comment

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

ditto here size must be equal with 1

Copy link
Member

Choose a reason for hiding this comment

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

while logically and semantically correct here, might prefer && and || instead of & and | here for programmability/correctness in case something becomes length > 1 here later

@SparkQA
Copy link

SparkQA commented Jun 16, 2017

Test build #78172 has finished for PR 18128 at commit 45b62cc.

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

Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

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

LGTM again.
@yanboliang do you want to take a last look before merging this?

@felixcheung
Copy link
Member

merged to master.

@asfgit asfgit closed this in 5354337 Jun 22, 2017
robert3005 pushed a commit to palantir/spark that referenced this pull request Jun 29, 2017
## What changes were proposed in this pull request?

PR apache#17715 Added Constrained Logistic Regression for ML. We should add it to SparkR.

## How was this patch tested?

Add new unit tests.

Author: wangmiao1981 <[email protected]>

Closes apache#18128 from wangmiao1981/test.
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