Skip to main content
Ctrl+K
scikit-bayes 1.5.0.post1.dev2 documentation - Home scikit-bayes 1.5.0.post1.dev2 documentation - Home
  • Installation
  • Getting Started
  • Tutorial
  • User Guide
  • API Reference
    • Example Gallery
    • Citing
    • Changelog
    • Contributing
    • Related software
  • GitHub
  • Installation
  • Getting Started
  • Tutorial
  • User Guide
  • API Reference
  • Example Gallery
  • Citing
  • Changelog
  • Contributing
  • Related software
  • GitHub
  • Example Gallery

Example Gallery#

This gallery contains examples demonstrating the capabilities of scikit-bayes. All examples use matplotlib for visualization and can be downloaded as Python scripts or Jupyter notebooks.

Start with the tutorial, which follows one problem on real data, a table of labels, from the table to the final evaluation. The other examples mostly use synthetic data, each built to show one property of a model; the last one shows what to expect on a table of continuous measurements.

Tutorial#

One problem on real data from the table to the final evaluation: the Car Evaluation data, a pandas DataFrame of labels fitted without an encoder, a comparison with scikit-learn baselines, a grid search, the learned structure against the known one, the weights, and the test set.

Tutorial: from a table of labels to a fitted network

Tutorial: from a table of labels to a fitted network

Mixed Naive Bayes#

The Naive Bayes classifier for data with continuous, categorical and binary attributes, and its equivalence with the scikit-learn estimators.

MixedNB on single-type data

MixedNB on single-type data

MixedNB on mixed continuous and categorical data

MixedNB on mixed continuous and categorical data

Generative AnDE Models#

Averaged n-Dependence Estimators: what they solve that Naive Bayes cannot, how their components are combined, and what the order of dependence costs.

Context-dependent rules on mixed data

Context-dependent rules on mixed data

XOR problem: AnDE and Naive Bayes

XOR problem: AnDE and Naive Bayes

Slice of the three-dimensional XOR problem

Slice of the three-dimensional XOR problem

Arithmetic or geometric mean with a failing sensor

Arithmetic or geometric mean with a failing sensor

Rare and unseen parent values

Rare and unseen parent values

Cost of the order of dependence

Cost of the order of dependence

Averaged n-join estimators#

AnJE and ALR, on discretized attributes or with Gaussian children: what the discriminative weights add to the generative model, and how much data they need.

AnJE or ALR: generative and discriminative n-joins

AnJE or ALR: generative and discriminative n-joins

Gaussian children or discretized attributes

Gaussian children or discretized attributes

Tree Augmented Naive Bayes#

A single Bayesian network in which every attribute depends on the class and on at most one other attribute: how the tree is learned and what it captures.

Learning the tree: TAN and naive Bayes

Learning the tree: TAN and naive Bayes

K-Dependence Bayesian Classifier#

A single Bayesian network in which every attribute depends on the class and on at most k other attributes: how k trades expressiveness for data.

Choosing k: KDB with increasing dependence

Choosing k: KDB with increasing dependence

Discriminatively weighted models#

Generative models with weights learned discriminatively, on the components of an ensemble or on the factors of a single network (WeightedTAN and WeightedKDB): the granularity of the weights, how to read them and their effect on calibration.

Component or factor weights: data efficiency and cost

Component or factor weights: data efficiency and cost

Component weights as a selection of super-parents

Component weights as a selection of super-parents

Calibration of generative and weighted models

Calibration of generative and weighted models

Weighted TAN and KDB on duplicated attributes

Weighted TAN and KDB on duplicated attributes

Discretization#

Supervised discretizers for continuous attributes.

Supervised discretization: where the cuts fall

Supervised discretization: where the cuts fall

Supervised discretization before a model

Supervised discretization before a model

Working with scikit-learn#

Pipelines, preprocessing and model selection around the estimators, and what to expect on a table of continuous measurements.

Pipelines and model selection with scikit-learn

Pipelines and model selection with scikit-learn

A table of continuous measurements: what to expect

A table of continuous measurements: what to expect

Download all examples in Python source code: auto_examples_python.zip

Download all examples in Jupyter notebooks: auto_examples_jupyter.zip

Gallery generated by Sphinx-Gallery

previous

check_installation

next

Tutorial

On this page
  • Tutorial
  • Mixed Naive Bayes
  • Generative AnDE Models
  • Averaged n-join estimators
  • Tree Augmented Naive Bayes
  • K-Dependence Bayesian Classifier
  • Discriminatively weighted models
  • Discretization
  • Working with scikit-learn
Edit on GitHub

This Page

  • Show Source

© Copyright 2025-2026, scikit-bayes developers.

Created using Sphinx 9.1.0.

Built with the PyData Sphinx Theme 0.16.1.