text_plain_output_1.png image_output_1.png
from sklearn.ensemble import RandomForestClassifier

from sklearn.metrics import accuracy_score, confusion_matrix, classification_report

from sklearn.preprocessing import StandardScaler

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

rfc = RandomForestClassifier(max_depth=7)
rfc.fit(X_train, y_train)
y_predRFC = rfc.predict(X_test)
scoreRFC = accuracy_score(y_test, y_predRFC)
print('ACCURACY OF ' + 'the KNeighboursClassifier model is: ' + str(scoreRFC * 100) + '%')