FeatureImportanceClassifier#
- class capymoa.feature.FeatureImportanceClassifier[source]#
Bases:
ClassifierBase class for classifiers that expose feature-importance estimates.
Subclass this when implementing a pure Python feature-importance method. MOA-backed learners should use
MOAFeatureImportanceClassifier.- classmethod from_params( ) Any[source]#
Construct an instance from parameters produced by
get_params.
- get_feature_importances(
- normalize: bool = True,
Return the current feature importance scores.
- predict(
- instance: Instance,
Predict the label of an instance.
The base implementation calls
predict_proba()and returns the label with the highest probability.- Parameters:
instance – The instance to predict the label for.
- Returns:
The predicted label or
Noneif the classifier is unable to make a prediction.
- abstract predict_proba(
- instance: Instance,
Return probability estimates for each label.
- Parameters:
instance – The instance to estimate the probabilities for.
- Returns:
An array of probabilities for each label or
Noneif the classifier is unable to make a prediction.
- abstract train(
- instance: LabeledInstance,
Train the classifier with a labeled instance.
- Parameters:
instance – The labeled instance to train the classifier with.