ModuleNotFoundError: No module named 'yellowbrick.features.importances'

发布时间 2023-10-23 11:12:26作者: 扬中源

报错:ModuleNotFoundError: No module named 'yellowbrick.features.importances'

改为:

from yellowbrick.features import FeatureImportances

 

from sklearn.ensemble import GradientBoostingClassifier
from yellowbrick.features import FeatureImportances

# Create a new matplotlib figure
fig = plt.figure()
ax = fig.add_subplot()

viz = FeatureImportances(GradientBoostingClassifier(), ax=ax)
viz.fit(X, y)
viz.poof()

https://www.scikit-yb.org/zh/latest/api/features/importances.html