image_output_1.png
from sklearn.ensemble import RandomForestClassifier

from sklearn.metrics import accuracy_score, recall_score

from sklearn.ensemble import RandomForestClassifier
rnd_clf = RandomForestClassifier(n_estimators=500, max_leaf_nodes=15, n_jobs=-1)
rnd_clf.fit(X_train, y_train)
rnd_clf_preds = rnd_clf.predict(X_test)
print('Accuracy of RandomForest on validation data : ', accuracy_score(y_test, rnd_clf_preds))
print('Recall of RandomForest on validation data : ', recall_score(y_test, rnd_clf_preds))