object
naive_bayes
Naive Bayes classifier with Laplace smoothing and Gaussian distribution support. Learns from a dataset object implementing the dataset_protocol protocol and returns a classifier term that can be used for prediction and exported as predicate clauses.
logtalk_load(naive_bayes(loader))static, context_switching_calls
Algorithm: Naive Bayes is a probabilistic classifier based on Bayes theorem with strong (naive) independence assumptions between features.
Categorical features: Uses Laplace smoothing to handle unseen feature values.
Continuous features: Uses Gaussian (normal) distribution to model numeric features.
Classifier representation: The learned classifier is represented by default as
nb_classifier(Classes, ClassPriors, AttributeNames, FeatureTypes, FeatureParams)whereFeatureParamscontains the learned probabilities or statistics for each feature.
Public predicates
predict_probabilities/3
Predicts class probabilities for a new instance using the learned classifier. Returns a list of Class-Probability pairs. The instance is a list of Attribute-Value pairs.
staticpredict_probabilities(Classifier,Instance,Probabilities)predict_probabilities(+compound,+list,-list) - oneProtected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)
See also
dataset_protocol, isolation_forest, c45, knn, nearest_centroid, random_forest, ada_boost