GaussianNaiveBayesResult
Snapshot from GaussianNaiveBayesStat: per-class feature statistics and class priors. Each row of means and variances holds the running mean / variance of every feature conditioned on a given class.
Prediction uses the standard Gaussian-NB log-posterior: log p(c | x) proportional to log prior[c] - 0.5 * Sum_i [log(2 pi var) + (x_i - mu)^2 / var] with varianceFloor applied to each per-class variance to keep the log term finite.
Constructors
Properties
Cumulative observation weight per class; length numClasses.
Number of input features.
K-by-p matrix of per-class running means; means[c][i] is the mean of feature i given class c.
Number of classes.
Total cumulative observation weight across all classes.
Lower bound applied to per-class variances at predict time.
K-by-p matrix of per-class running variances (population, weight-normalised).
Functions
Unnormalised log-posterior log prior[c] + Sum_i log N(x_i | mu_c, var_c).
Argmax class index for x.
Normalised class probabilities via log-sum-exp on the log-posterior.
GaussianNaiveBayesResult
classWeights
Cumulative observation weight per class; length numClasses.
featureSize
Number of input features.
logPosterior
Unnormalised log-posterior log prior[c] + Sum_i log N(x_i | mu_c, var_c).
means
K-by-p matrix of per-class running means; means[c][i] is the mean of feature i given class c.
numClasses
Number of classes.
predict
Argmax class index for x.
prior
probabilities
Normalised class probabilities via log-sum-exp on the log-posterior.
totalWeights
Total cumulative observation weight across all classes.
varianceFloor
Lower bound applied to per-class variances at predict time.
variances
K-by-p matrix of per-class running variances (population, weight-normalised).