ShapFeatureSelector¶
- class mastml.feature_selectors.ShapFeatureSelector(model, n_features_to_select, make_plot=False, max_display=10)[source]¶
Bases:
BaseSelector
Class custom-written for MAST-ML to conduct selection of features with SHAP
- Args:
model: (mastml.models object), a MAST-ML compatable model
n_features_to_select: (int), the number of features to select
make_plot: Saves the plot of SHAP value if True, default is False
max_display: maximum number of feature to display in the plot
- Methods:
- fit: performs feature selection
- Args:
X: (dataframe), dataframe of X features
y: (dataframe), dataframe of y data
- Returns:
None
- transform: performs the transform to generate output of only selected features
- Args:
X: (dataframe), dataframe of X features
- Returns:
dataframe: (dataframe), dataframe of selected X features
Methods Summary
fit
(X, y)transform
(X)Methods Documentation