hyperimpute.plugins.prediction.classifiers.base module
- class ClassifierPlugin(random_state: int = 0, **kwargs: Any)
Bases:
ClassifierMixin
,BaseEstimator
,PredictionPlugin
Base class for the classifier plugins.
It provides the implementation for plugin.Plugin’s subtype, _fit and _predict methods.
- Each derived class must implement the following methods(inherited from plugin.Plugin):
name() - a static method that returns the name of the plugin. hyperparameter_space() - a static method that returns the hyperparameters that can be tuned during the optimization. The method will return a list of Params derived objects.
If any method implementation is missing, the class constructor will fail.
- _abc_impl = <_abc_data object>
- get_args() dict
- module_relative_path: Optional[Path]
- score(X: DataFrame, y: DataFrame, metric: str = 'aucroc') float
Return the mean accuracy on the given test data and labels.
In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.
- Parameters:
X (array-like of shape (n_samples, n_features)) – Test samples.
y (array-like of shape (n_samples,) or (n_samples, n_outputs)) – True labels for X.
sample_weight (array-like of shape (n_samples,), default=None) – Sample weights.
- Returns:
score – Mean accuracy of
self.predict(X)
wrt. y.- Return type:
float
- static subtype() str