Skip to content
Snippets Groups Projects
Commit 6519fd06 authored by Xiangrui Meng's avatar Xiangrui Meng Committed by Joseph K. Bradley
Browse files

[SPARK-9665] [MLLIB] audit MLlib API annotations

I only found `ml.NaiveBayes` missing `Experimental` annotation. This PR doesn't cover Python APIs.

cc jkbradley

Author: Xiangrui Meng <meng@databricks.com>

Closes #8452 from mengxr/SPARK-9665.
parent bb164052
No related branches found
No related tags found
No related merge requests found
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
package org.apache.spark.ml.classification package org.apache.spark.ml.classification
import org.apache.spark.SparkException import org.apache.spark.SparkException
import org.apache.spark.ml.{PredictorParams, PredictionModel, Predictor} import org.apache.spark.annotation.Experimental
import org.apache.spark.ml.param.{ParamMap, ParamValidators, Param, DoubleParam} import org.apache.spark.ml.PredictorParams
import org.apache.spark.ml.param.{DoubleParam, Param, ParamMap, ParamValidators}
import org.apache.spark.ml.util.Identifiable import org.apache.spark.ml.util.Identifiable
import org.apache.spark.mllib.classification.{NaiveBayes => OldNaiveBayes} import org.apache.spark.mllib.classification.{NaiveBayes => OldNaiveBayes, NaiveBayesModel => OldNaiveBayesModel}
import org.apache.spark.mllib.classification.{NaiveBayesModel => OldNaiveBayesModel}
import org.apache.spark.mllib.linalg._ import org.apache.spark.mllib.linalg._
import org.apache.spark.mllib.regression.LabeledPoint import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.rdd.RDD import org.apache.spark.rdd.RDD
...@@ -59,6 +59,7 @@ private[ml] trait NaiveBayesParams extends PredictorParams { ...@@ -59,6 +59,7 @@ private[ml] trait NaiveBayesParams extends PredictorParams {
} }
/** /**
* :: Experimental ::
* Naive Bayes Classifiers. * Naive Bayes Classifiers.
* It supports both Multinomial NB * It supports both Multinomial NB
* ([[http://nlp.stanford.edu/IR-book/html/htmledition/naive-bayes-text-classification-1.html]]) * ([[http://nlp.stanford.edu/IR-book/html/htmledition/naive-bayes-text-classification-1.html]])
...@@ -68,6 +69,7 @@ private[ml] trait NaiveBayesParams extends PredictorParams { ...@@ -68,6 +69,7 @@ private[ml] trait NaiveBayesParams extends PredictorParams {
* ([[http://nlp.stanford.edu/IR-book/html/htmledition/the-bernoulli-model-1.html]]). * ([[http://nlp.stanford.edu/IR-book/html/htmledition/the-bernoulli-model-1.html]]).
* The input feature values must be nonnegative. * The input feature values must be nonnegative.
*/ */
@Experimental
class NaiveBayes(override val uid: String) class NaiveBayes(override val uid: String)
extends ProbabilisticClassifier[Vector, NaiveBayes, NaiveBayesModel] extends ProbabilisticClassifier[Vector, NaiveBayes, NaiveBayesModel]
with NaiveBayesParams { with NaiveBayesParams {
...@@ -101,11 +103,13 @@ class NaiveBayes(override val uid: String) ...@@ -101,11 +103,13 @@ class NaiveBayes(override val uid: String)
} }
/** /**
* :: Experimental ::
* Model produced by [[NaiveBayes]] * Model produced by [[NaiveBayes]]
* @param pi log of class priors, whose dimension is C (number of classes) * @param pi log of class priors, whose dimension is C (number of classes)
* @param theta log of class conditional probabilities, whose dimension is C (number of classes) * @param theta log of class conditional probabilities, whose dimension is C (number of classes)
* by D (number of features) * by D (number of features)
*/ */
@Experimental
class NaiveBayesModel private[ml] ( class NaiveBayesModel private[ml] (
override val uid: String, override val uid: String,
val pi: Vector, val pi: Vector,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment