feature importance random forest regression code example
Example 1: sklearn random forest feature importance
import pandas as pd
forest_importances = pd.Series(importances, index=feature_names)
fig, ax = plt.subplots()
forest_importances.plot.bar(yerr=std, ax=ax)
ax.set_title("Feature importances using MDI")
ax.set_ylabel("Mean decrease in impurity")
fig.tight_layout()
Example 2: sklearn random forest feature importance
print(__doc__)
import matplotlib.pyplot as plt