text_plain_output_1.png
from sklearn.ensemble import RandomForestClassifier

from sklearn.metrics import accuracy_score, confusion_matrix, classification_report

from sklearn.model_selection import GridSearchCV

from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
X_test = scaler.transform(X_test)

from sklearn.model_selection import GridSearchCV
param_grid = {'n_estimators': [5, 7, 10, 11, 12], 'criterion': ['gini', 'entropy', 'log_loss'], 'max_depth': [7, 8, 9, 10], 'max_features': ['sqrt', 'log2']}
cv = GridSearchCV(RandomForestClassifier(), param_grid=param_grid, refit=True, cv=5, verbose=0)

cv.fit(X_train, y_train)
y_predCV = cv.predict(X_test)
scoreRFC_CV = accuracy_score(y_test, y_predCV)

cv.best_estimator_