text_plain_output_1.png
from sklearn import ensemble

import matplotlib.pyplot as plt

import pandas as pd

import xgboost as xgb

xgb = xgb.XGBRFRegressor()
tree = ensemble.RandomForestRegressor()
ada = ensemble.AdaBoostRegressor()
grad = ensemble.GradientBoostingRegressor()

clf = ensemble.AdaBoostRegressor(n_estimators=500, learning_rate=0.5)
selector = clf.fit(X_train, y_train)
feat_imp = pd.Series(clf.feature_importances_, index=X_train.columns.values).sort_values(ascending=False)
feat_imp[:40].plot(kind='bar', title='Feature Importances according to AdaBoostRegressor', figsize=(12, 8))
plt.ylabel('Feature Importance Score')
plt.subplots_adjust(bottom=0.3)
plt.show()