fuzzyclust.models.select_features_by_separability#

fuzzyclust.models.select_features_by_separability(X, y, n_features_to_select=1, criterion='det', **classifier_params)[source]#

Backward feature elimination by the Fisher interclass separability of the rules.

The step-wise procedure of Abonyi and Szeifert (2003): a SupervisedFuzzyClassifier is identified on the current feature set, the separability \(J_{-j}\) without each feature is computed (SupervisedFuzzyClassifier.feature_importance()), the feature whose removal reduces \(J\) least is deleted, and the classifier is re-identified on the reduced data. The training accuracy after every step is recorded so that the number of features can be chosen where the performance starts to drop.

Parameters:
Xarray_like of shape (n_samples, n_features)
yarray_like of shape (n_samples,)
n_features_to_selectint, default=1

Stop when this many features remain.

criterion{“det”, “trace”}, default=”det”

See SupervisedFuzzyClassifier.interclass_separability().

**classifier_params

Passed to SupervisedFuzzyClassifier (e.g. n_clusters, random_state).

Returns:
selectedndarray of int

Indices of the remaining features (in the original order).

eliminatedlist of int

Features in the order of their removal.

historypandas.DataFrame

One row per step: n_features, removed (-1 before the first removal), separability \(J\) and training accuracy of the classifier identified on the features of that step.

References

[1]

J. Abonyi, F. Szeifert, “Supervised fuzzy clustering for the identification of fuzzy classifiers”, Pattern Recognition Letters, 24(14), 2195–2207, 2003.

Examples

>>> from fuzzyclust.datasets import load_iris
>>> from fuzzyclust.models import select_features_by_separability
>>> iris = load_iris()
>>> sel, order, hist = select_features_by_separability(
...     iris.data, iris.target, n_features_to_select=2, n_clusters=3, random_state=0)
>>> len(sel), len(order), list(hist.columns)
(2, 2, ['n_features', 'removed', 'separability', 'accuracy'])

Examples using fuzzyclust.models.select_features_by_separability#

Supervised fuzzy clustering: classifier rules that carry class probabilities

Supervised fuzzy clustering: classifier rules that carry class probabilities