| Did you know ... | Search Documentation: |
| Pack logtalk -- logtalk-3.98.0/docs/apis/_sources/naive_bayes_0.rst.txt |
.. index:: single: naive_bayes .. _naive_bayes/0:
.. rst-class:: right
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.
| Availability:
| logtalk_load(naive_bayes(loader))
| Author: Paulo Moura | Version: 1:0:0 | Date: 2026-02-20
| Compilation flags:
| static, context_switching_calls
| Implements:
| public :ref:`classifier_protocol <classifier_protocol/0>`
| Uses:
| :ref:`format <format/0>`
| :ref:`list <list/0>`
| :ref:`pairs <pairs/0>`
| :ref:`population <population/0>`
| Remarks:
nb_classifier(Classes, ClassPriors, AttributeNames, FeatureTypes, FeatureParams) where FeatureParams contains the learned probabilities or statistics for each feature.| Inherited public predicates: | Â :ref:`classifier_protocol/0::classifier_to_clauses/4` Â :ref:`classifier_protocol/0::classifier_to_file/4` Â :ref:`classifier_protocol/0::learn/2` Â :ref:`classifier_protocol/0::predict/3` Â :ref:`classifier_protocol/0::print_classifier/1` Â
.. contents:: :local: :backlinks: top
.. index:: predict_probabilities/3 .. _naive_bayes/0::predict_probabilities/3:
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.
| Compilation flags:
| static
| Template:
| predict_probabilities(Classifier,Instance,Probabilities)
| Mode and number of proofs:
| predict_probabilities(+compound,+list,-list) - one
(no local declarations; see entity ancestors if any)
(no local declarations; see entity ancestors if any)
(none)
.. seealso::
:ref:`dataset_protocol <dataset_protocol/0>`, :ref:`isolation_forest <isolation_forest/0>`, :ref:`c45 <c45/0>`, :ref:`knn <knn/0>`, :ref:`nearest_centroid <nearest_centroid/0>`, :ref:`random_forest <random_forest/0>`, :ref:`ada_boost <ada_boost/0>`