pyreal.RealApp.prepare_feature_importance#
- RealApp.prepare_feature_importance(x_train_orig=None, y_train=None, model_id=None, algorithm=None, shap_type=None, training_size=None)[source]#
Initialize and fit a global feature importance explainer
- Parameters:
model_id (int or string) – Model id to explain
x_train_orig (DataFrame of shape (n_instances, n_features)) – Training data, if not provided at initialization.
y_train (DataFrame or Series) – Training targets, if not provided at initialization
algorithm (string) – GFI algorithm to use
shap_type (string) – If algorithm is “shap”, type of shap to use
training_size (int) – Number of rows to use in fitting explainer
- Returns:
A fit GlobalFeatureImportance explainer