Skip to content

Instantly share code, notes, and snippets.

View mohit-sinha's full-sized avatar

Mohit Sinha mohit-sinha

View GitHub Profile
@mohit-sinha
mohit-sinha / xgb_bo.py
Created June 29, 2018 11:54
Bayesian Optimisation for XGBoost
from bayes_opt import BayesianOptimization
from sklearn.cross_validation import KFold
import xgboost as xgb
import numpy
def xgbCv(train, features, numRounds, eta, gamma, maxDepth, minChildWeight, subsample, colSample):
# prepare xgb parameters
params = {
"objective": "binary:logistic",
"booster" : "gbtree",
@mohit-sinha
mohit-sinha / lgb_bo.py
Created June 27, 2018 11:51
Use this for LightGBM parameter optimisation by Bayesian optimisation.
import pandas as pd;
import numpy as np;
import lightgbm as lgb
from bayes_opt import BayesianOptimization
from sklearn.model_selection import cross_val_score
def lgb_evaluate(
numLeaves,
maxDepth,
scaleWeight,