-
Notifications
You must be signed in to change notification settings - Fork 28k
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
[ML][docs][minor] Define LabeledDocument/Document classes in CV example #5135
Conversation
To easier copy/paste Cross-Validation example code snippet need to define LabeledDocument/Document in it, since they difined in a previous example.
Can one of the admins verify this patch? |
It seems reasonable, but adds a fair bit of code to the Java example. I'm not sure if the intent was that it be runnable, or simply illustrate a snippet of the core API usage. @mengxr |
I'm okay with this change, which makes the example self-contained and hence users can try it out easily. |
add to whitelist |
ok to test |
// Labeled and unlabeled instance types. | ||
// Spark SQL can infer schema from Java Beans. | ||
public class Document implements Serializable { | ||
private Long id; |
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.
Long
-> long
Test build #29051 has started for PR 5135 at commit
|
Test build #29051 has finished for PR 5135 at commit
|
Test PASSed. |
Test build #29088 has started for PR 5135 at commit
|
Test build #29088 has finished for PR 5135 at commit
|
Test PASSed. |
@@ -655,6 +660,36 @@ import org.apache.spark.sql.DataFrame; | |||
import org.apache.spark.sql.Row; | |||
import org.apache.spark.sql.SQLContext; | |||
|
|||
// Labeled and unlabeled instance types. |
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.
OK so this is intentionally duplicated from the example above? I guess that's reasonable since the point is to be self-contained, and I don't imagine there's a lot of maintenance overhead in trying to evolve both copies together.
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.
Yes it's annoying when copy/pasting a bunch of code into spark shell and it fails because these classes are not declared.
To easier copy/paste Cross-Validation example code snippet need to define LabeledDocument/Document in it, since they difined in a previous example. Author: Peter Rudenko <petro.rudenko@gmail.com> Closes #5135 from petro-rudenko/patch-3 and squashes the following commits: 5190c75 [Peter Rudenko] Fix primitive types for java examples. 1d35383 [Peter Rudenko] [SQL][docs][minor] Define LabeledDocument/Document classes in CV example (cherry picked from commit 08d4528) Signed-off-by: Sean Owen <sowen@cloudera.com>
To easier copy/paste Cross-Validation example code snippet need to define LabeledDocument/Document in it, since they difined in a previous example.