public final class DiscreteNaiveBayesModel extends Object implements IgniteModel<Vector,Double>, Exportable<DiscreteNaiveBayesModel>, Serializable
y belongs to a class C_k, k in [0..K] as
p(C_k,y) =x_1*p_k1^x *...*x_i*p_ki^x_i. Where x_i is a discrete feature, p_ki is a prior
probability probability of class p(x|C_k). Returns the number of the most possible class.| Constructor and Description |
|---|
DiscreteNaiveBayesModel(double[][][] probabilities,
double[] clsProbabilities,
double[] labels,
double[][] bucketThresholds,
DiscreteNaiveBayesSumsHolder sumsHolder) |
| Modifier and Type | Method and Description |
|---|---|
double[][] |
getBucketThresholds() |
double[] |
getClsProbabilities() |
double[][][] |
getProbabilities() |
DiscreteNaiveBayesSumsHolder |
getSumsHolder() |
Double |
predict(Vector vector)
Make a prediction for the specified input arguments.
|
<P> void |
saveModel(Exporter<DiscreteNaiveBayesModel,P> exporter,
P path)
Save model by the given path.
|
public DiscreteNaiveBayesModel(double[][][] probabilities,
double[] clsProbabilities,
double[] labels,
double[][] bucketThresholds,
DiscreteNaiveBayesSumsHolder sumsHolder)
probabilities - Probabilities of features for classes.clsProbabilities - Prior probabilities for classes.bucketThresholds - The threshold to convert a feature to a binary value.sumsHolder - Amount values which are abouve the threshold per label.labels - Labels.public <P> void saveModel(Exporter<DiscreteNaiveBayesModel,P> exporter, P path)
saveModel in interface Exportable<DiscreteNaiveBayesModel>exporter - Exporter.path - Path to saved model.public Double predict(Vector vector)
Modelpublic double[][][] getProbabilities()
public double[] getClsProbabilities()
public double[][] getBucketThresholds()
public DiscreteNaiveBayesSumsHolder getSumsHolder()
GridGain In-Memory Computing Platform : ver. 8.9.26 Release Date : October 16 2025