Uh oh!
There was an error while loading. Please reload this page.
[SPARK-19281][PYTHON][ML] spark.ml Python API for FPGrowth - #17218
[SPARK-19281][PYTHON][ML] spark.ml Python API for FPGrowth#17218zero323 wants to merge 22 commits into
Conversation
SparkQA
commented
Mar 9, 2017
Test build #74230 has finished for PR 17218 at commit
|
SparkQA
commented
Mar 10, 2017
Test build #74354 has finished for PR 17218 at commit
|
SparkQA
commented
Mar 11, 2017
Test build #74356 has finished for PR 17218 at commit
|
jkbradley
commented
Mar 13, 2017
Thanks for the PR! I'll wait until this isn't "WIP" to review it thoroughly, but I'll make two comments now:
|
zero323
commented
Mar 13, 2017
@jkbradley Thanks for the comment. I thought about |
jkbradley
commented
Mar 13, 2017
True, if minSupport can be shared, then that's OK. confidence won't be shared though. |
zero323
commented
Mar 13, 2017
@jkbradley As far as I remember some variants of Somewhat related - could you take a look at SPARK-19899? |
SparkQA
commented
Mar 14, 2017
Test build #74534 has finished for PR 17218 at commit
|
bebb363 to
9074312CompareSparkQA
commented
Mar 16, 2017
Test build #74630 has finished for PR 17218 at commit
|
SparkQA
commented
Mar 16, 2017
Test build #74632 has finished for PR 17218 at commit
|
9bde018 to
0a3798dCompareNote: should be retested after #17321 is resolved. |
SparkQA
commented
Mar 19, 2017
Test build #74827 has finished for PR 17218 at commit
|
zero323
commented
Mar 20, 2017
Jenkins retest this please. |
SparkQA
commented
Mar 20, 2017
Test build #74895 has finished for PR 17218 at commit
|
SparkQA
commented
Mar 20, 2017
Test build #74898 has finished for PR 17218 at commit
|
zero323
commented
Mar 21, 2017
@jkbradley I think this is ready for review. |
jkbradley
commented
Mar 23, 2017
Sure, I can take a look. Let me ping @MLnick too since he marked himself as shepherd |
jkbradley
left a comment
There was a problem hiding this comment.
I'm only partly done reviewing, but I'll go ahead and send some comments. Thanks for the PR!
There was a problem hiding this comment.
This check happens on the Scala side; let's not replicate it here.
There was a problem hiding this comment.
To be honest I don't like this approach so I'll try to make the case for keeping this "as-is".
If we depend on Scala checks we fail late by delaying this to the point where transform is called. If this happens in the middle of a complex pipeline then it is simply expensive so my opinion is that if we can fail early without significant overhead then we should.
There was a problem hiding this comment.
Match Scala doc: "Note that minConfidence has no effect during fitting."
There was a problem hiding this comment.
remove period "." from end of doc string here
There was a problem hiding this comment.
No need for this. The default will be set in FPGrowth
There was a problem hiding this comment.
Also, it'd be good to be able to set minConfidence, itemsCol and predictionCol (for associationRules and transform)
There was a problem hiding this comment.
I pushed my first attempt but I think will require a bit more discussion. If enable this here should we do the same for the rest of Python models?
There was a problem hiding this comment.
Python style: put triple-quotes on a line by themselves (here and elsewhere below)
There was a problem hiding this comment.
Done.
Side note: Should we add it to https://spark.apache.org/contributing.html (PEP8 recommends only the closing quote to be placed in a separate line).
jkbradley
commented
Mar 23, 2017
Issue this PR brought up:
|
SparkQA
commented
Mar 25, 2017
Test build #75219 has finished for PR 17218 at commit
|
jkbradley
left a comment
There was a problem hiding this comment.
Thanks for the updates!
Also, it'd be good to be able to set minConfidence, itemsCol and predictionCol (for associationRules and transform)
I pushed my first attempt but I think will require a bit more discussion. If enable this here should we do the same for the rest of Python models?
True, we should do it for all models. And you're right that it's more involved than I was thinking. Specifically, rather than calling setParams from _create_model, I'd want us to call _copyValues from fit() in order to eliminate duplicate code. Would you mind removing the Params from the model, and we can work on adding them in more carefully for the next release? Thanks a lot!
I dug up the existing JIRA for this issue: https://issues.apache.org/jira/browse/SPARK-10931
Side note: Should we add it to https://spark.apache.org/contributing.html (PEP8 recommends only the closing quote to be placed in a separate line).
I would say yes...except I see it is inconsistent elsewhere in Spark. I guess I won't push for it anymore.
There was a problem hiding this comment.
As long as you're at it, switch tuning & tests to alphabetize them
There was a problem hiding this comment.
Sure thing, I thought there is some logic in putting tests last. Should I reorder the other modules as well?
There was a problem hiding this comment.
Interesting...maybe? I guess it doesn't really matter, so no need to rearrange more.
There was a problem hiding this comment.
On this topic, I agree with you that not checking here could currently cause late failures in a Pipeline. However, I think the right fix for this is to add PipelineStage and transformSchema() to Python. I just made a JIRA for it: https://issues.apache.org/jira/browse/SPARK-20099
There was a problem hiding this comment.
Extra quotes here. Does this come out formatted correctly?
There was a problem hiding this comment.
Put first in doc string (See examples elsewhere)
There was a problem hiding this comment.
I just realized: If we're leaving open the possibility of returning multiple elements here in the future, then let's not document that this has a single element (else it effectively becomes a guarantee in the API).
There was a problem hiding this comment.
I didn't see this before, so now this is noted twice. Just put it once at the beginning of the docstring.
SparkQA
commented
Mar 26, 2017
Test build #75230 has finished for PR 17218 at commit
|
| """ | ||
| if not (0 <= value <= 1): | ||
| raise ValueError("Support must be in range [0, 1]") | ||
| return self._set(minSupport=value) |
There was a problem hiding this comment.
This removed too much! This line should remain
SparkQA
commented
Mar 26, 2017
Test build #75237 has finished for PR 17218 at commit
|
zero323
commented
Mar 26, 2017
Jenkins retest this please. |
zero323
commented
Mar 26, 2017
I removed the code and I'll be following SPARK-10931. One possible challenge (here and for parameters validation) is high latency of Py4j calls. With large pipelines it can build up pretty fast. |
SparkQA
commented
Mar 26, 2017
Test build #75241 has finished for PR 17218 at commit
|
jkbradley
commented
Mar 26, 2017
LGTM |
jkbradley
commented
Mar 26, 2017
@indyragandy What do you mean by "get directly"? |
## What changes were proposed in this pull request? Follow-up for #17218, some minor fix for PySpark ```FPGrowth```. ## How was this patch tested? Existing UT. Author: Yanbo Liang <ybliang8@gmail.com> Closes#18089 from yanboliang/spark-19281. (cherry picked from commit 913a6bf) Signed-off-by: Yanbo Liang <ybliang8@gmail.com>
## What changes were proposed in this pull request? Follow-up for apache#17218, some minor fix for PySpark ```FPGrowth```. ## How was this patch tested? Existing UT. Author: Yanbo Liang <ybliang8@gmail.com> Closesapache#18089 from yanboliang/spark-19281.
What changes were proposed in this pull request?
HasSupportandHasConfidenceParams.pyspark.ml.fpm.FPGrowth/FPGrowthModelwrappers.How was this patch tested?
Unit tests.