-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-2515][mllib] Chi Squared test #1733
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ff17423
WIP
dorx 6598379
API and code structure.
dorx 706d436
Added API for RDD[Vector]
dorx 3d61582
input names
dorx e6b83f3
reviewer comments
dorx 4e4e361
WIP
dorx 50703a5
merge master
dorx bc7eb2e
unit passed; still need docs and some refactoring
dorx 5686082
facelift
dorx d64c2fb
Merge branch 'master' into chisquare
dorx 7eea80b
WIP
dorx e90d90a
Merge branch 'master' into chisquare
dorx c39eeb5
units passed with updated API
dorx 80d03e2
Reviewer comments.
dorx 7dde711
ChiSqTestResult renaming and changed to Class
dorx e95e485
reviewer comments.
dorx d286783
Merge branch 'master' into chisquare
dorx cafb3a7
fixed p-value for extreme case.
dorx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
reviewer comments
- Loading branch information
commit e6b83f35375701f71f699697a83236e7e0c76d6c
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does it need to be a case class? Scala compiler will add many methods to a case class and make it very hard to extend.
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.
Case class is a logical choice here since it's essentially an immutable object holding a bunch of invariant fields and doesn't do any stateful computations inside of the class. Is there development plan for extending this classes in the future?
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.
No case class features are used, especially pattern matching. This case class will extend
Product5and make it impossible to add a field, for example, whether correction is used or not. Also, with a case class, it is very hard to add a static method. We might want to write the test result to JSON and later parse it back. A natural choice would beChiSquaredTestResult.fromJSON(json: String)but it is very complicated to match the type signature generated by Scala's compiler. We had this problem withLabeledPointin MLlib, which is a public case class.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.
Btw, shall we rename it to
ChiSqTestResult? SochiSqTest() returns ChiSqTestResult.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.
Whether correction is used or not can actually be reflected in the method name (
pearsonvyates). I doubt there's a lot of use cases for parsing the result back from JSON so let's not worry about it for now (also, don't static methods usually come in the companion object anyway?). The way I see case classes is that they're like data structs that encapsulates immutable fields (the list of fields can be modified in later releases given that this is all experimental) and we get free getter methods for constructor arguments with a case class, but if there are compiler optimization complications, I can change it to a regular class.