pyreal.RealApp.produce_feature_importance#

RealApp.produce_feature_importance(model_id=None, x_train_orig=None, y_train=None, algorithm=None, format_output=True, shap_type=None, force_refit=False, training_size=None, num_features=None, select_by='absolute')[source]#

Produce a GlobalFeatureImportance explainer

Parameters:
  • model_id (string or int) – ID of model to explain

  • x_train_orig (DataFrame) – Data to fit on, if not provided during initialization

  • y_train (DataFrame or Series) – Training targets to fit on, if not provided during initialization

  • algorithm (string) – Name of algorithm

  • format_output (Boolean) – If False, return output as a single DataFrame. Formatted outputs are more usable but take longer to generate.

  • shap_type (string) – If algorithm=”shap”, type of SHAP explainer to use

  • force_refit (Boolean) – If True, initialize and fit a new explainer even if the appropriate explainer already exists

  • training_size (int) – Number of rows to use in fitting explainer

  • num_features (int) – Number of features to include in the explanation. If None, include all features

  • select_by (one of "absolute", "min", "max") – If num_features is not None, method to use for selecting which features to show. Not used if num_features is None

Returns:

DataFrame with a Feature Name column and an Importance column