-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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-8481] [MLlib] GaussianMixtureModel.predict, GaussianMixtureModel.predictSoft variants for a single vector #6906
Conversation
OK to test |
ok to test |
Test build #35290 has finished for PR 6906 at commit
|
A blank line with two space characters (added by IDE) caused the test to fail. Is there some source code validation tool I could apply to my code before contributing? |
Jenkins, retest this please. |
I think that this particular build failure is due to code that failed our style checker being committed to master; we've fixed this with a hotfix commit. You can use the |
Test build #35306 has finished for PR 6906 at commit
|
Test build #35318 has finished for PR 6906 at commit
|
@dkobylarz Thanks for the PR! This looks fine, but could you please add a simple test to the unit tests? It could be a new unit test in the GMM suite, or just an extra line testing this method in an existing unit test. |
Ping |
it will be added on Monday |
Great thanks! |
Test build #36568 has finished for PR 6906 at commit
|
I quickly reviewed the Jenkins log. Mllib tests seem to be passed, it's the sql test that fails. Have there been any changes to 1.4 branch that are responsible for it? |
Jenkins, retest this please. |
@dkobylarz Could you please update the PR description to say what was done in this PR? It will become part of the git commit message (so the current description does not quite fit). Jenkins test this please |
@@ -66,6 +66,12 @@ class GaussianMixtureModel( | |||
responsibilityMatrix.map(r => r.indexOf(r.max)) | |||
} | |||
|
|||
/** Maps given point to its cluster index. */ | |||
def predict(point: Vector) : Int = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scala style: no space between parenthesis and colon
Test build #37547 has finished for PR 6906 at commit
|
@dkobylarz Could you please update the PR description to say what was done in this PR? It will become part of the git commit message (so the current description does not quite fit). Also, as you make updates, it is helpful if you only rebase in order to fix merge conflicts. Otherwise, it's hard to tell what changes you have made in each update. I'll take another look. |
Description updated. |
What did you update the description to? I still see "This PR addresses the issue I have just reported. After taking a look at the code It seemed trivial to implement.", which says nothing about what this PR is doing. (Is github being slow to update or something?) When this PR gets merged, the merge script will squash all commits in this PR anyways. Separating commits during review makes review easier. |
This LGTM once the PR description is updated. Thanks! |
Could you please tell me how to edit the PR description. In this view I am only able to edit the PR title. |
Nevermind, I didn't realize the first comment in this stream is also the PR description. |
@dkobylarz No problem, this looks fine now. I'll merge it with master. |
…el.predictSoft variants for a single vector This PR adds GaussianMixtureModel.predict & GaussianMixtureModel.predictSoft variants for a single vector which are useful when applying the trained model in environments where spark context is not required (or not desired) and predictions are made for single data points (vectors). Test case included. Author: Dariusz Kobylarz <darek.kobylarz@gmail.com> Closes #6906 from dkobylarz/branch-1.4 and squashes the following commits: cef1f0a [Dariusz Kobylarz] [SPARK-8481] [MLlib] GaussianMixtureModel predict accepting single vector
@dkobylarz The merge script failed to close this for some reason. Would you mind closing it manually? Thanks |
Done |
@jkbradley let me just check, was this PR merged into only Related to: #7662 |
Uh oh, I'm not sure how I ended up merging that with branch-1.4...that's very strange. I'll see about fixing that. |
@dkobylarz I just reverted this change in branch-1.4. It was because this PR was targeted at branch-1.4, rather than the master. Please make sure PRs are targeted at the master branch in the future (and I will need to be more careful at merge time!). I'll create a new PR and send it for branch-1.5 and master. |
ok, I was thinking of getting this to 1.4 branch asap. I will contribute to master branch only in future. Sorry about that and thanks for the guidance! |
No problem, I need to be careful too! |
@jkbradley @dkobylarz I appreciate your checking! I look forward to merging it into the master branch! |
…ctor Resubmit of [#6906] for adding single-vec predict to GMMs CC: dkobylarz mengxr To be merged with master and branch-1.5 Primary author: dkobylarz Author: Dariusz Kobylarz <darek.kobylarz@gmail.com> Closes #8039 from jkbradley/gmm-predict-vec and squashes the following commits: bfbedc4 [Dariusz Kobylarz] [SPARK-8481] [MLlib] GaussianMixtureModel predict accepting single vector (cherry picked from commit e2fbbe7) Signed-off-by: Joseph K. Bradley <joseph@databricks.com>
…ctor Resubmit of [#6906] for adding single-vec predict to GMMs CC: dkobylarz mengxr To be merged with master and branch-1.5 Primary author: dkobylarz Author: Dariusz Kobylarz <darek.kobylarz@gmail.com> Closes #8039 from jkbradley/gmm-predict-vec and squashes the following commits: bfbedc4 [Dariusz Kobylarz] [SPARK-8481] [MLlib] GaussianMixtureModel predict accepting single vector
…ctor Resubmit of [apache#6906] for adding single-vec predict to GMMs CC: dkobylarz mengxr To be merged with master and branch-1.5 Primary author: dkobylarz Author: Dariusz Kobylarz <darek.kobylarz@gmail.com> Closes apache#8039 from jkbradley/gmm-predict-vec and squashes the following commits: bfbedc4 [Dariusz Kobylarz] [SPARK-8481] [MLlib] GaussianMixtureModel predict accepting single vector
…ctor Resubmit of [apache/spark#6906] for adding single-vec predict to GMMs CC: dkobylarz mengxr To be merged with master and branch-1.5 Primary author: dkobylarz Author: Dariusz Kobylarz <darek.kobylarz@gmail.com> Closes #8039 from jkbradley/gmm-predict-vec and squashes the following commits: bfbedc4 [Dariusz Kobylarz] [SPARK-8481] [MLlib] GaussianMixtureModel predict accepting single vector
This PR adds GaussianMixtureModel.predict & GaussianMixtureModel.predictSoft variants for a single vector which are useful when applying the trained model in environments where spark context is not required (or not desired) and predictions are made for single data points (vectors).
Test case included.