text_plain_output_1.png
"""import lightgbm
params = [
    {
#       'regressor__regressor': [lightgbm.LGBMRegressor()],
        'regressor__regressor__boosting_type': ['gbdt'],
        'regressor__regressor__n_estimators': [100],
        'regressor__regressor__max_depth': [20],
        'regressor__regressor__learning_rate' : [0.1],
        'regressor__regressor__num_leaves' : [31],
    },
]
gsc = GridSearchCV(
        estimator=lightgbm.LGBMRegressor(),
        param_grid=params,
        cv=320,
        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_)
lgbreg = lightgbm.LGBMRegressor(boosting_type='gbdt', num_leaves=31, learning_rate=0.1, n_estimators=100, max_depth = 20)
lgbreg.fit(X_train, Y_train)
print("train score", lgbreg.score(X_train, Y_train))
print("test score", lgbreg.score(X_test, Y_test))
#print("crossVal score", cross_val_score(lgbreg, X, Y, cv=3).mean())"""