8.10. copro.evaluation.get_feature_importance

copro.evaluation.get_feature_importance(clf, config, out_dir)[source]

Determines relative importance of each feature (i.e. variable) used. Must be used after model/classifier is fit. Returns dataframe and saves it to csv too.

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

  • config (ConfigParser-object) – object containing the parsed configuration-settings of the model.

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

Raises

Warning – raised if the chosen ML model has not built-in feature importances.

Returns

dataframe containing feature importance.

Return type

dataframe