def get_model(PARAMS): model = XGBClassifier(booster='gbtree', silent=True, nthread=None, random_state=42, base_score=0.5, colsample_bylevel=1, n_estimators=50, reg_lambda=1, objective='binary:logistic') model.max_depth = PARAMS.get("max_depth") model.min_child_weight = PARAMS.get("min_child_weight") model.gamma = PARAMS.get("gamma") model.subsample = PARAMS.get("subsample") model.colsample_bytree = PARAMS.get("colsample_bytree") model.reg_alpha = PARAMS.get('reg_alpha') model.learning_rate = PARAMS.get("learning_rate") return model