Shortcuts

lumin.nn.interpretation package

Submodules

lumin.nn.interpretation.features module

lumin.nn.interpretation.features.get_nn_feat_importance(model, fy, eval_metric=None, pb_parent=None, plot=True, savename=None, settings=<lumin.plotting.plot_settings.PlotSettings object>)[source]

Compute permutation importance of features used by a Model on provided data using either loss or an EvalMetric to quantify performance. Returns bootstrapped mean importance from sample constructed by computing importance for each fold in fy.

Parameters
  • model (AbsModel) – Model to use to evaluate feature importance

  • fy (FoldYielder) – FoldYielder interfacing to data used to train model

  • eval_metric (Optional[EvalMetric]) – Optional EvalMetric to use to quantify performance in place of loss

  • pb_parent (Optional[ConsoleMasterBar]) – Not used if calling method directly

  • plot (bool) – whetehr to plot resulting feature importances

  • savename (Optional[str]) – Optional name of file to which to save the plot of feature importances

  • settings (PlotSettings) – PlotSettings class to control figure appearance

Return type

DataFrame

Returns

Pandas DataFrame containing mean importance and associated uncertainty for each feature

Examples::
>>> fi = get_nn_feat_importance(model, train_fy)
>>>
>>> fi = get_nn_feat_importance(model, train_fy, savename='feat_import')
>>>
>>> fi = get_nn_feat_importance(model, train_fy,
...                             eval_metric=AMS(n_total=100000))
lumin.nn.interpretation.features.get_ensemble_feat_importance(ensemble, fy, eval_metric=None, savename=None, settings=<lumin.plotting.plot_settings.PlotSettings object>)[source]

Compute permutation importance of features used by an Ensemble on provided data using either loss or an EvalMetric to quantify performance. Returns bootstrapped mean importance from sample constructed by computing importance for each Model in ensemble.

Parameters
  • ensemble (AbsEnsemble) – Ensemble to use to evaluate feature importance

  • fy (FoldYielder) – FoldYielder interfacing to data used to train models in ensemble

  • eval_metric (Optional[EvalMetric]) – Optional EvalMetric to use to quantify performance in place of loss

  • savename (Optional[str]) – Optional name of file to which to save the plot of feature importances

  • settings (PlotSettings) – PlotSettings class to control figure appearance

Return type

DataFrame

Returns

Pandas DataFrame containing mean importance and associated uncertainty for each feature

Examples::
>>> fi = get_ensemble_feat_importance(ensemble, train_fy)
>>>
>>> fi = get_ensemble_feat_importance(ensemble, train_fy
...                                   savename='feat_import')
>>>
>>> fi = get_ensemble_feat_importance(ensemble, train_fy,
...                                   eval_metric=AMS(n_total=100000))

Module contents

Read the Docs v: v0.3.1
Versions
latest
stable
v0.3.2
v0.3.1
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.

Docs

Access comprehensive developer and user documentation for LUMIN

View Docs

Tutorials

Get tutorials for beginner and advanced researchers demonstrating many of the features of LUMIN

View Tutorials