API Reference#

scikit-learn compatible classifiers#

TreeClassifier([criterion, splitter, ...])

A decision tree classifier with support for nominal attributes.

NaiveBayesClassifier([smoothing, backend, ...])

A Naive Bayes classifier supporting nominal attributes.

ZeroRClassifier([criterion, backend, ...])

A ZeroR classifier, equivalent to a TreeClassifier with a depth of 0 (only root).

OneRClassifier([criterion, backend, ...])

A OneR classifier, equivalent to a TreeClassifier with a depth of 1 (root and children).

CN2Classifier([criterion, max_rule_length, ...])

A rule-based classifier that performs sequential covering in a CN2 [1] style.

PRISMClassifier([max_rule_length, ...])

A PRISM classifier.

scikit-learn compatible regressors#

TreeRegressor([criterion, splitter, ...])

A decision tree regressor for nominal and numeric attributes.

ZeroRRegressor([criterion, backend])

A ZeroR Regressor, equivalent to a TreeClassifier with a depth of 0 (only root).

OneRRegressor([criterion, backend])

A OneR Regressor, equivalent to a TreeClassifier with a depth of 1.

CN2Regressor([criterion, max_rule_length, ...])

A rule-based regressor that performs sequential covering in a CN2 [1] style.

Base classes#

BaseTree defines the pruning parameters for both TreeRegressor and TreeClassifier. Nominal* classes define base methods to support inference with nominal attributes

Same thing with

sklearn.tree_base.BaseTree([criterion, ...])

Base class for decision trees with native nominal attribute support.

sklearn.nominal_model.NominalModel([backend])

Mixin class for all nominal models in sklearn_nominal.

sklearn.nominal_model.NominalClassifier([...])

Base class for nominal classifiers.

sklearn.nominal_model.NominalRegressor([backend])

Base class for nominal regressors.

Dataset classes#

In order to support nominal attributes, and facilitate the implementation of various estimators, sklearn_nominal abstracts away the details of a dataset with the corresponding Dataset class and implementations, including many common method such as filtering datasets on attribute-value conditions. Currently, only a pandas backend is available, but future versions may include polars or pure numpy backends.

backend.Dataset()

A Dataset abstracts away the contents of a dataset and provides common operations, specially filtering and statistics operations, to implement models that support nominal attributes.

backend.PandasDataset(x, y[, idx])

backend.Condition(column)

A condition to filter rows of a :class: Dataset