autoqild.mi_estimators.mi_base_classΒΆ
Base class for all Mutual Information estimators.
Classes
|
- class autoqild.mi_estimators.mi_base_class.MIEstimatorBase(n_classes, n_features, random_state)[source]ΒΆ
Bases:
BaseEstimator,ClassifierMixin- decision_function(X, verbose=0)[source]ΒΆ
Predict confidence scores for samples, sometimes conincciding with the probability scores in X. The confidence score for a sample is proportional to the signed distance of that sample to the hyperplane.
- Parameters:
X (array-like of shape (n_samples, n_features)) β Input samples.
- Returns:
y_proba β Predicted class probabilities.
- Return type:
array-like of shape (n_samples, n_classes)
- Raises:
NotImplementedError β If the method is not implemented by the subclass.
- estimate_mi(X, y, **kwargs)[source]ΒΆ
Estimate Mutual Information using the specified method.
- Parameters:
X (array-like of shape (n_samples, n_features)) β Input data.
y (array-like of shape (n_samples,)) β Target labels.
**kwargs (dict, optional) β Additional keyword arguments passed to the estimation methods.
- Returns:
mutual_information β A mean of estimated MI values from cross-validation splits.
- Return type:
float
- Raises:
NotImplementedError β If the method is not implemented by the subclass.
- fit(**kwd)[source]ΒΆ
Fit the mutual information estimation model to the data.
- Parameters:
X (array-like of shape (n_samples, n_features)) β Training data.
y (array-like of shape (n_samples,)) β Target labels.
**kwd (dict, optional) β Additional keyword arguments passed to the fit method of the classifier.
- Returns:
self β Fitted estimator.
- Return type:
object
- get_params(deep=True)[source]ΒΆ
Get parameters for this estimator.
- Parameters:
deep (bool, default=True) β If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns:
params β Parameter names mapped to their values.
- Return type:
dict
- predict(X, verbose=0)[source]ΒΆ
Predict class labels for samples in X.
- Parameters:
X (array-like of shape (n_samples, n_features)) β Input samples.
- Returns:
y_pred β Predicted class labels.
- Return type:
array-like of shape (n_samples,)
- Raises:
NotImplementedError β If the method is not implemented by the subclass.
- predict_proba(X, verbose=0)[source]ΒΆ
Predict class probabilities for samples in X.
- Parameters:
X (array-like of shape (n_samples, n_features)) β Input samples.
- Returns:
y_proba β Predicted class probabilities.
- Return type:
array-like of shape (n_samples, n_classes)
- Raises:
NotImplementedError β If the method is not implemented by the subclass.
- score(X, y, sample_weight=None, verbose=0)[source]ΒΆ
Return the score based on the metric on the given test data and labels.
- 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)w.r.t. y.- Return type:
float
- Raises:
NotImplementedError β If the method is not implemented by the subclass.
- set_params(**parameters)[source]ΒΆ
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline). The latter have parameters of the form<component>__<parameter>so that itβs possible to update each component of a nested object.- Parameters:
**params (dict) β Estimator parameters.
- Returns:
self β Estimator instance.
- Return type:
estimator instance