Uh oh!
There was an error while loading. Please reload this page.
[SPARK-6083] [MLLib] [DOC] Make Python API example consistent in NaiveBayes - #4834
[SPARK-6083] [MLLib] [DOC] Make Python API example consistent in NaiveBayes#4834MechCoder wants to merge 2 commits into
Conversation
SparkQA
commented
Feb 28, 2015
Test build #28130 has started for PR 4834 at commit
|
MechCoder
commented
Feb 28, 2015
cc: @mengxr Would you be able to verify this? |
MechCoder
commented
Feb 28, 2015
Hmm. I get an a accuracy of zero for the given example. Not sure where I'm going wrong though :( |
SparkQA
commented
Feb 28, 2015
Test build #28130 has finished for PR 4834 at commit
|
AmplabJenkins
commented
Feb 28, 2015
Test PASSed. |
MechCoder
commented
Mar 1, 2015
I changed the randomSplit seed and it works better. It should look good now. |
SparkQA
commented
Mar 1, 2015
Test build #28139 has started for PR 4834 at commit
|
SparkQA
commented
Mar 1, 2015
Test build #28139 has finished for PR 4834 at commit
|
AmplabJenkins
commented
Mar 1, 2015
Test PASSed. |
mengxr
commented
Mar 1, 2015
@MechCoder Thanks for the update! We only have 6 lines in |
MechCoder
commented
Mar 1, 2015
Great. Do you have any more comments? |
There was a problem hiding this comment.
We can define a parse function to make the code more readable. Btw, we use 4 space indentation in Python, following PEP8.
defparseLine(line):
parts=line.split(',')
label=float(parts[0])
features=Vector.dense([float(x) forxinparts[1].split(' ')])
returnLabeledPoint(label, features)
data=sc.textFile('data/mllib/sample_naive_bayes_data.txt').map(parseLine)MechCoder
commented
Mar 1, 2015
@mengxr fixed ! |
SparkQA
commented
Mar 1, 2015
Test build #28152 has started for PR 4834 at commit
|
mengxr
commented
Mar 1, 2015
LGTM. |
SparkQA
commented
Mar 1, 2015
Test build #28152 has finished for PR 4834 at commit
|
AmplabJenkins
commented
Mar 1, 2015
Test PASSed. |
…eBayes Author: MechCoder <manojkumarsivaraj334@gmail.com> Closes#4834 from MechCoder/spark-6083 and squashes the following commits: 1cdd7b5 [MechCoder] Add parse function 65bbbe9 [MechCoder] [SPARK-6083] Make Python API example consistent in NaiveBayes (cherry picked from commit 3f00bb3) Signed-off-by: Xiangrui Meng <meng@databricks.com>
mengxr
commented
Mar 2, 2015
Merged into master and branch-1.3. Thanks! |
No description provided.