public final class GaussianNaiveBayesModel extends Object implements IgniteModel<Vector,Double>, Exportable<GaussianNaiveBayesModel>, Serializable
y
belongs to a class C_k, k in [0..K]
as p(C_k,y) = p(C_k)*p(y_1,C_k) *...*p(y_n,C_k) / p(y)
. Return the number of the most possible class.Constructor and Description |
---|
GaussianNaiveBayesModel(double[][] means,
double[][] variances,
double[] classProbabilities,
double[] labels,
org.apache.ignite.ml.naivebayes.gaussian.GaussianNaiveBayesSumsHolder sumsHolder) |
Modifier and Type | Method and Description |
---|---|
double[] |
getClassProbabilities() |
double[][] |
getMeans() |
org.apache.ignite.ml.naivebayes.gaussian.GaussianNaiveBayesSumsHolder |
getSumsHolder() |
double[][] |
getVariances() |
Double |
predict(Vector vector)
Returns a number of class to which the input belongs.
|
<P> void |
saveModel(Exporter<GaussianNaiveBayesModel,P> exporter,
P path)
Save model by the given path.
|
public GaussianNaiveBayesModel(double[][] means, double[][] variances, double[] classProbabilities, double[] labels, org.apache.ignite.ml.naivebayes.gaussian.GaussianNaiveBayesSumsHolder sumsHolder)
means
- Means of features for all classes.variances
- Variances of features for all classes.classProbabilities
- Probabilities for all classes.labels
- Labels.sumsHolder
- Feature sum, squared sum and count sum per label. This data is used for future model updating.public <P> void saveModel(Exporter<GaussianNaiveBayesModel,P> exporter, P path)
saveModel
in interface Exportable<GaussianNaiveBayesModel>
exporter
- Exporter.path
- Path to saved model.public double[][] getMeans()
public double[][] getVariances()
public double[] getClassProbabilities()
public org.apache.ignite.ml.naivebayes.gaussian.GaussianNaiveBayesSumsHolder getSumsHolder()
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024