# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

from bp.section1_video5_data import get_data

from sklearn import model_selection

from xgboost import XGBClassifier

seed=123

X, Y = get_data('data/video1_diabetes.csv')

c = XGBClassifier(random_state=seed)

n_trees=range(50, 500, 50)

max_depth=range(1, 4)

params_to_search = dict(n_estimators=n_trees, max_depth=max_depth)

grid_search = model_selection.GridSearchCV(c, params_to_search, scoring='neg_log_loss', n_jobs=-1, cv=10, iid=False)

grid_results = grid_search.fit(X, Y)

grid_results.best_params_

grid_results.cv_results_['mean_test_score']

grid_results.cv_results_['params']



StarcoderdataJupyterScriptsDedupFiltered