LearningNaiveBayes

Naive-Bayes models. Trainers in the scikit-learn NaiveBayes family, behind Learning's typed contract. Each requires a clean training set (``independent_target`` and no missing values) and stamps the model with the dataset's feature/class count. ``open LearningNaiveBayes`` brings the core types in scope too.
Imports
open LearningCore;
Table of Contents

Functions

gaussian_nb

def gaussian_nb (ds: {d : Dataset | independent_target d = True && has_missing d = False}) : {m : SklearnClassifier | clf_features m = ds_features ds && clf_classes m = ds_classes ds}

multinomial_nb

def multinomial_nb (ds: {d : Dataset | independent_target d = True && has_missing d = False}) : {m : SklearnClassifier | clf_features m = ds_features ds && clf_classes m = ds_classes ds}

complement_nb

ComplementNB targets imbalanced data — refining out the balanced case guides callers toward the right tool. Discharge with ``if Learning.balanced ds then ... else Learning.complement_nb ds``.
def complement_nb (ds: {d : Dataset | is_balanced d = False && (independent_target d = True && has_missing d = False)}) : {m : SklearnClassifier | clf_features m = ds_features ds && clf_classes m = ds_classes ds}

bernoulli_nb

def bernoulli_nb (ds: {d : Dataset | independent_target d = True && has_missing d = False}) : {m : SklearnClassifier | clf_features m = ds_features ds && clf_classes m = ds_classes ds}