Decision Tree Backward¶
skfeature.function.wrapper.decision_tree_backward
Description¶
Decision Tree Backward is a wrapper method that starts from the full feature set and greedily removes the least useful feature at each step, based on the cross-validated accuracy of a Decision Tree classifier.
Usage¶
import numpy as np
from sklearn.datasets import load_iris
from skfeature.function.wrapper import decision_tree_backward
X, y = load_iris(return_X_y=True)
# rank features by cross-validated classifier performance
score = decision_tree_backward.decision_tree_backward(X, y)
Parameters¶
X:numpy array, shape(n_samples, n_features)— input datay:numpy array, shape(n_samples,)— class labelsn_selected_features:int— number of features to selectmode:{"rank", "index"}, default"rank"
Returns¶
score:numpy array, shape(n_features,)— ranking score of every feature, aligned withsklearn.feature_selection.SelectKBest
References¶
- Original implementation from the DMML Lab@ASU Feature Selection Repository.