lambda-ml.naive-bayes

Naive Bayes probabilistic model learning.

Example usage:

(def data [[6.0 180 12 :male] [5.92 190 11 :male] [5.58 170 12 :male]
           [5.92 165 10 :male] [5.0 100 6 :female] [5.5 150 8 :female]
           [5.42 130 7 :female] [5.75 150 9 :female]])
(def fit
  (-> (make-naive-bayes)
      (naive-bayes-fit data)))
(naive-bayes-predict fit [[6.0 130 8]])
;;=> (:female)

gaussian

(gaussian x mean var)

make-naive-bayes

(make-naive-bayes)

Returns a naive Bayes model.

naive-bayes-fit

(naive-bayes-fit model data)(naive-bayes-fit model x y)

Returns a naive Bayes model fit to the given training data.

naive-bayes-predict

(naive-bayes-predict model x)

Predicts the values of example data using a naive Bayes model.

posterior

(posterior distributions xi label)