public class NaiveBayesModel extends Object implements ClassificationModel, scala.Serializable
Constructor and Description |
---|
NaiveBayesModel(double[] labels,
double[] pi,
double[][] theta) |
Modifier and Type | Method and Description |
---|---|
double[] |
labels() |
double[] |
pi() |
RDD<Object> |
predict(RDD<Vector> testData)
Predict values for the given data set using the model trained.
|
double |
predict(Vector testData)
Predict values for a single data point using the model trained.
|
double[][] |
theta() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
predict
public NaiveBayesModel(double[] labels, double[] pi, double[][] theta)
public double[] labels()
public double[] pi()
public double[][] theta()
public RDD<Object> predict(RDD<Vector> testData)
ClassificationModel
predict
in interface ClassificationModel
testData
- RDD representing data points to be predictedpublic double predict(Vector testData)
ClassificationModel
predict
in interface ClassificationModel
testData
- array representing a single data point