Skip to content

Instantly share code, notes, and snippets.

@unnir
Created November 21, 2017 14:34
Show Gist options
  • Save unnir/f6d0a84695a99c2ca1470c79ccc22115 to your computer and use it in GitHub Desktop.
Save unnir/f6d0a84695a99c2ca1470c79ccc22115 to your computer and use it in GitHub Desktop.
num_ensembles = 7
y_pred = 0.0
for i in tqdm(range(num_ensembles)):
model = CatBoostClassifier(random_seed = i+2, gradient_iterations = i+1 ,leaf_estimation_method ='Newton', learning_rate=0.057, l2_leaf_reg = 23, depth=6, od_pval=0.0000001, iterations = 920, loss_function='Logloss')
fit_model = model.fit(train_data)
y_pred += fit_model.predict_proba(test_data)[:,1]
y_pred /= num_ensembles
gc.collect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment