I am trying tune my random forest classifier to maximize the recall . How can I can plot Probability vs Recall in Pandas dataframe.
My current code to print the classification report
from sklearn import metrics
predicted_randomforest = fit_rf.predict_proba(df1)
predictions=pd.DataFrame(predicted_randomforest)
predictions['outcome'] = np.where(predictions[0]>=0.85,0,1)
print(metrics.confusion_matrix(Y_test, predictions['outcome']))
print(np.mean(predictions['outcome'] == Y_test) )
target_names=['Business','Resi']
print(classification_report(Y_test,predictions['outcome'],target_names=target_names))
Output
precision recall f1-score support
Business 1.00 0.96 0.98 76742
Resi 0.73 0.97 0.83 8442
avg / total 0.97 0.96 0.96 85184
I want plot Probability in x -axis and recall value in Y- axis.Any help is appreciated.