Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created February 4, 2021 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/dcc3fe5b17c876b70729fed8051a0b48 to your computer and use it in GitHub Desktop.
Save amankharwal/dcc3fe5b17c876b70729fed8051a0b48 to your computer and use it in GitHub Desktop.
train_dataset = cb.Pool(X_train,y_train,
cat_features=categorical_indicies)
test_dataset = cb.Pool(X_test,y_test,
cat_features=categorical_indicies)
model = cb.CatBoostClassifier(loss_function='Logloss',
eval_metric='Accuracy')
grid = {'learning_rate': [0.03, 0.1],
'depth': [4, 6, 10],
'l2_leaf_reg': [1, 3, 5,],
'iterations': [50, 100, 150]}
model.grid_search(grid,train_dataset)
pred = model.predict(X_test)
print(classification_report(y_test, pred))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment