text_html_output_1.png
from sklearn.model_selection import train_test_split, GridSearchCV

from sklearn.tree import DecisionTreeClassifier

param_grid = [{'criterion': ['gini', 'entropy'], 'splitter': ['best', 'random']}]
grid = GridSearchCV(estimator=DecisionTreeClassifier(random_state=42), param_grid=param_grid, cv=5)
grid.fit(X_train, y_train)

grid.best_params_

grid.score(X_train, y_train)

grid.score(X_test, y_test)