Skip to content

Conversation

@hhbyyh
Copy link
Contributor

@hhbyyh hhbyyh commented Feb 2, 2016

jira: https://issues.apache.org/jira/browse/SPARK-13089

Add section in ml-classification.md for NaiveBayes DataFrame-based API, plus example code (using include_example to clip code from examples/ folder files).

@SparkQA
Copy link

SparkQA commented Feb 2, 2016

Test build #50531 has finished for PR 11015 at commit be5586b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@hhbyyh hhbyyh changed the title [SPARK-13089] [Doc] spark.ml Naive Bayes user guide and examples [SPARK-13089][ML] [Doc] spark.ml Naive Bayes user guide and examples Feb 14, 2016
package org.apache.spark.examples.ml;

// $example on$
import org.apache.spark.SparkConf;
Copy link
Member

Choose a reason for hiding this comment

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

I would not include SparkConf or JavaSparkContext

@jkbradley
Copy link
Member

test this please

@SparkQA
Copy link

SparkQA commented Apr 8, 2016

Test build #55389 has finished for PR 11015 at commit be5586b.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 10, 2016

Test build #55471 has finished for PR 11015 at commit 769595f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@hhbyyh
Copy link
Contributor Author

hhbyyh commented Apr 10, 2016

Thanks for the review. Updated according to the comments.

probabilistic classifiers based on applying Bayes' theorem with strong (naive) independence
assumptions between the features. More information about the spark.ml implementation can be
found further in the section on [Naive Bayes in MLlib](mllib-naive-bayes.html#naive-bayes-sparkmllib).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to clarify ml.NaiveBayes supports Multinomial NB and Bernoulli NB. Meanwhile, we should provide the link to corresponding documents. You can refer the NaiveBayes API doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking a look. The wiki link already provided a good overall introduction to Naive Bayes. I'll add some clarification. And in the mllib documents, it clarifies naive Bayes supports both Multinomial and Bernoulli.

@SparkQA
Copy link

SparkQA commented Apr 12, 2016

Test build #55596 has finished for PR 11015 at commit 03d22b3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

.setLabelCol("label")
.setPredictionCol("prediction")
.setMetricName("precision")
val accuracy = evaluator.evaluate(predictions)
Copy link
Member

Choose a reason for hiding this comment

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

I would call it "precision" instead of "accuracy" since it might confuse people (even though they are the same here).

@jkbradley
Copy link
Member

Just that 1 comment

@SparkQA
Copy link

SparkQA commented Apr 13, 2016

Test build #55694 has finished for PR 11015 at commit e27fe71.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jkbradley
Copy link
Member

LGTM
Merging with master
Thanks!

@asfgit asfgit closed this in 781df49 Apr 13, 2016
@hhbyyh
Copy link
Contributor Author

hhbyyh commented Apr 14, 2016

Thanks @jkbradley

Sign up for free to 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.

4 participants