src.plot.rand_forestpp_plot

Classes

RandForestPPPlot(importance, **kwargs)

class src.plot.rand_forestpp_plot.RandForestPPPlot(importance, **kwargs)
Author:

Alberto M. Esmoris Pena

Class to plot the evaluation of trained C++ random forest models. See RandForestPPEvaluation.

Since the C++ backend does not expose individual decision tree structures in a format compatible with sklearn’s plot_tree, this class plots a feature importance bar chart instead.

Variables:
  • importance (np.ndarray) – The MDI feature importance scores.

  • permutation_importance_mean (np.ndarray or None) – The permutation importance means.

  • fnames (list) – The feature names.

__init__(importance, **kwargs)

Initialize/instantiate a RandForestPPPlot.

Parameters:
  • importance – The feature-wise MDI importance scores.

  • kwargs – The attributes for the RandForestPPPlot.

plot(**kwargs)

Plot feature importances as horizontal bar charts.

When permutation importances are available, a two-subplot layout is used: MDI on the left (labels on the left axis) and permutation importance on the right (labels on the right axis, bars growing right-to-left). Both subplots share the same feature ordering (sorted by MDI).

See plot.Plot.plot().