text_plain_output_1.png
from sklearn import ensemble

import catboost

import sklearn
sklearn_boost = ensemble.GradientBoostingRegressor(loss='ls', learning_rate=0.1, n_estimators=100)
sklearn_boost.fit(X_train, Y_train)

import catboost
cboost = catboost.CatBoostRegressor(loss_function='RMSE', verbose=False)
cboost.fit(X_train, Y_train)

import sklearn
params = {'learning_rate': [0.05], 'n_estimators': [200], 'max_depth': [6]}
gsc = GridSearchCV(estimator=ensemble.GradientBoostingRegressor(), param_grid=params, cv=3)
grid_result = gsc.fit(X_train, Y_train)
sklearn_boost = ensemble.GradientBoostingRegressor(loss='ls', learning_rate=0.1, n_estimators=200, max_depth=6)
sklearn_boost.fit(X_train, Y_train)

from catboost import CatBoost
params = {'depth': [7], 'learning_rate': [0.15], 'l2_leaf_reg': [15, 20, 25], 'iterations': [300], 'verbose': [False]}
gsc = GridSearchCV(estimator=catboost.CatBoostRegressor(), param_grid=params, cv=3, scoring='r2', verbose=0, n_jobs=-1)
grid_result = gsc.fit(X_train, Y_train)
print('Best params:', grid_result.best_params_)
print('Best score:', grid_result.best_score_)
cboost = catboost.CatBoostRegressor(loss_function='RMSE', verbose=False, learning_rate=0.15, l2_leaf_reg=20, iterations=300)
cboost.fit(X_train, Y_train)
print('train score', cboost.score(X_train, Y_train))
print('test score', cboost.score(X_test, Y_test))