8.11. copro.evaluation.get_permutation_importance

copro.evaluation.get_permutation_importance(clf, X_ft, Y, df_feat_imp, out_dir)[source]

Returns a dataframe with the mean permutation importance of the features used to train a RF tree model. Dataframe is stored to output directory as csv-file.

Parameters
  • clf (classifier) – sklearn-classifier used in the simulation.

  • X_ft (array) – X-array containing variable values after scaling.

  • Y (array) – Y-array containing conflict data.

  • df_feat_imp (dataframe) – dataframe containing feature importances to align names across outputs.

  • out_dir (str) – path to output folder. If ‘None’, no output is stored.

Returns

contains mean permutation importance for each feature.

Return type

dataframe