edaflow.ml.plot_feature_importance

edaflow.ml.plot_feature_importance(model: BaseEstimator, feature_names: List[str], top_n: int = 20, title: str | None = None, figsize: Tuple[int, int] = (10, 8)) Figure[source]

Plot feature importance for models that support it.

Parameters:

modelBaseEstimator

Fitted model with feature_importances_ attribute

feature_namesList[str]

Names of the features

top_nint, default=20

Number of top features to display

titlestr, optional

Plot title

figsizeTuple[int, int], default=(10, 8)

Figure size

Returns:

plt.Figure

The matplotlib figure