Skip to content

[SPARK-8674] [MLlib] Implementation of a 2 sample Kolmogorov Smirnov Test - #7075

Closed
josepablocam wants to merge 8 commits into
apache:masterfrom
josepablocam:twoSampleKSTest
Closed

[SPARK-8674] [MLlib] Implementation of a 2 sample Kolmogorov Smirnov Test#7075
josepablocam wants to merge 8 commits into
apache:masterfrom
josepablocam:twoSampleKSTest

Conversation

@josepablocam

Copy link
Copy Markdown

The current patch implements a 2-sample, 2-sided Kolmogorov Smirnov test. Similarly to the 1-sample implementation, we seek to reduce the shuffles necessary for computation. The user can provide 2 RDD[Double] and the Statistics.ksTest function allows them to test the null hypothesis that both samples came from the same probability distribution.

This patch includes the 1-sample test (so that reviewers can see the broader context of the change), however, that portion (and relevant tests) are being reviewed at https://issues.apache.org/jira/browse/SPARK-8598.

@srowen

Copy link
Copy Markdown
Member

So this isn't to be merged in its current form? Put [WIP] in the title. This should probably just be reviewed later if/when the other PR is merged.

@josepablocamjosepablocam changed the title [SPARK-8674] [MLlib] Implementation of a 2 sample Kolmogorov Smirnov Test[SPARK-8674] [MLlib] [WIP] Implementation of a 2 sample Kolmogorov Smirnov TestJul 7, 2015
@sryza

Copy link
Copy Markdown
Contributor

Hey @josepablocam can you rebase this on current master?

@josepablocam

Copy link
Copy Markdown
Author

@sryza yes, will do.

@josepablocamjosepablocam changed the title [SPARK-8674] [MLlib] [WIP] Implementation of a 2 sample Kolmogorov Smirnov Test[SPARK-8674] [MLlib] Implementation of a 2 sample Kolmogorov Smirnov TestJul 21, 2015
@mengxr

Copy link
Copy Markdown
Contributor

@sryza Do you want to make another pass? Please sign off if you think this is ready:)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Call this unionedData

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

changed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it be clearer to write true and false instead of isSample1 and !isSample1? I don't have a strong opinion.
Can the map functions be like .map((_, isSample1)) for tidiness or does that syntax not work here?
Finally I wonder if .union is clearer than ++ here? I don't have a strong opinion either, just am somehow used to method invocations on RDDs and ++-like syntax for Scala collections.

@sryza

Copy link
Copy Markdown
Contributor

@mengxr@josepablocam oops thought it was still a WIP for some reason. Just took a pass. It looks mostly done - I just had a bunch of nits and a test request.

@josepablocam

Copy link
Copy Markdown
Author

Mmm. I seem to be having some issues building and testing on my laptop. It keeps failing when building Catalyst. I'll try this first thing in the morning at work and push if it passes tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.sortByKey? I think the mapPartitions doesn't need braces, just parens, but that's tiny.

…to account for aliasing of commons' KS test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: I'd make the above one "Sample follows the theoretical distribution" or make the bottom one "Both samples follow same distribution".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

fixed. Modified the first. Thanks

…ical functions are package private and can be tested more directly
@sryza

sryza commented Aug 4, 2015

Copy link
Copy Markdown
Contributor

jenkins, test this please

@sryza

sryza commented Aug 4, 2015

Copy link
Copy Markdown
Contributor

This LGTM pending jenkins

@mengxr

Copy link
Copy Markdown
Contributor

test this please

@SparkQA

Copy link
Copy Markdown

Test build #39872 has finished for PR 7075 at commit 16ba96e.

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

@josepablocam

Copy link
Copy Markdown
Author

ugh, did not reword the tests in pyspark after we slightly cleaned up the grammar in the 2 sample test. I will make the ks 2 sample test hypothesis statement match the grammar in the first. Sorry about this!

… unit test failure by reversing prior grammar change
@sryza

Copy link
Copy Markdown
Contributor

@mengxr is it too late to get this in to 1.5?

@josepablocam are you able to resolve merge conflicts?

@josepablocam

Copy link
Copy Markdown
Author

@sryza fixed merge conflicts

@SparkQA

Copy link
Copy Markdown

Test build #58715 has finished for PR 7075 at commit feacda0.

  • This patch fails Spark unit tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #69329 has finished for PR 7075 at commit feacda0.

  • This patch fails Spark unit tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@HyukjinKwon

Copy link
Copy Markdown
Member

@josepablocam, it looks the conflicts were not resolved cleanly. Would you resolve them?

@josepablocam

josepablocam commented Jun 19, 2017 via email

Copy link
Copy Markdown
Author

@HyukjinKwonHyukjinKwon mentioned this pull request Jun 25, 2017
@gatorsmile

Copy link
Copy Markdown
Member

We are closing it due to inactivity. please do reopen if you want to push it forward. Thanks!

zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
## What changes were proposed in this pull request?
This PR proposes to close stale PRs, mostly the same instances with apache#18017
I believe the author in apache#14807 removed his account.
Closesapache#7075Closesapache#8927Closesapache#9202Closesapache#9366Closesapache#10861Closesapache#11420Closesapache#12356Closesapache#13028Closesapache#13506Closesapache#14191Closesapache#14198Closesapache#14330Closesapache#14807Closesapache#15839Closesapache#16225Closesapache#16685Closesapache#16692Closesapache#16995Closesapache#17181Closesapache#17211Closesapache#17235Closesapache#17237Closesapache#17248Closesapache#17341Closesapache#17708Closesapache#17716Closesapache#17721Closesapache#17937
Added:
Closesapache#14739Closesapache#17139Closesapache#17445Closesapache#18042Closesapache#18359
Added:
Closesapache#16450Closesapache#16525Closesapache#17738
Added:
Closesapache#16458Closesapache#16508Closesapache#17714
Added:
Closesapache#17830Closesapache#14742
## How was this patch tested?
N/A
Author: hyukjinkwon <gurwls223@gmail.com>
Closesapache#18417 from HyukjinKwon/close-stale-pr.
Sign up for freeto 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.

7 participants

@josepablocam@srowen@sryza@mengxr@SparkQA@HyukjinKwon@gatorsmile