
<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
How to Train a Catboost Classifier with GridSearch Hyperparameter Tuning

<ASSISTANT_TASK:>
Python Code::
import catboost as cb
#Create datasets
train_dataset = cb.Pool(X_train,y_train, cat_features=categorical_indicies)
eval_dataset = cb.Pool(X_val,y_val, cat_features=categorical_indicies)
model = cb.CatBoostClassifier(iterations=1000, 
                              loss_function='Logloss', 
                              eval_metric='Accuracy')
#Declare parameters to tune and values to try
grid = {'learning_rate': [0.03, 0.1],
        'depth': [4, 6, 10],
        'l2_leaf_reg': [1, 3, 5,]}
#Find optimum parameters
model.grid_search(grid,train_dataset,plot=True)
#Fit model with early stopping if improvement hasn't been made within 50 iterations
model.fit(train_dataset, 
          eval_set=eval_dataset,
          early_stopping_rounds=50,
          plot=True,
          silent=False)

<END_TASK>
