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
SupervisedFuzzyClassifieris 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
ofshape(n_samples,n_features) - yarray_like
ofshape(n_samples,) - n_features_to_select
int, default=1 Stop when this many features remain.
- criterion{“det”, “trace”}, default=”det”
- **classifier_params
Passed to
SupervisedFuzzyClassifier(e.g.n_clusters,random_state).
- Xarray_like
- Returns:
- selected
ndarrayofint Indices of the remaining features (in the original order).
- eliminated
listofint Features in the order of their removal.
- history
pandas.DataFrame One row per step:
n_features,removed(-1before the first removal),separability\(J\) and trainingaccuracyof the classifier identified on the features of that step.
- selected
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