Classifier
Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- class Classifier(*args, **kwargs)[source]
Bases:
ProtocolOutcome model over feature tables.
Named
Classifier(notModel) so it can never be confused withHabitatModel, the habitat-definition artefact. The feature column set is captured atfittime;predictvalidates it, catching silent schema drift between training and prediction tables.- fit(table: FeatureTable) Classifier[source]
Train on a table with an outcome column.
- Parameters:
table – Training table with feature columns and a binary or categorical outcome column.
- Returns:
self, fitted.
- predict(table: FeatureTable) Series[source]
Predict class labels for a table’s rows.
- Parameters:
table – Table carrying the feature columns seen at fit time.
- Returns:
Predicted labels indexed by the table’s identifier columns.
- predict_proba(table: FeatureTable) DataFrame[source]
Predict class probabilities for a table’s rows.
- Parameters:
table – Table carrying the feature columns seen at fit time.
- Returns:
Probability frame indexed by the identifier columns, one column per class.
- __init__(*args, **kwargs)