#arg1= all y datapoints #arg2= all x datapoints #label these datapoints #linewidth is the width of the line #marker is the symbol used for plotting datapoints #s is the size if the marker plt.figure(1) #arg1 flagsize=(w,h) plt.subplot(nrows=x,ncols=y,figsize=(x,y)).set_axis_off() #2 is the number of row to divide figure into #1 is the number of col to divide figure into #1 is the current active figure plt.grid() plt.legand() plt.ylabel("") plt.xlabel("") plt.title("") plt.show() plt.axis(off) plt.close() #........................................................................ plt.imshow() #arg:- #X [m,n,3],[m,n,4],[m,n] #cmap (matplotlib.colors.Colormap) (ignored if RBGA/RGB values are given) #aspect (equals, auto) maintains the aspect ration (ie square pixels) #interpolation plt.imread()
#AUC Scores from sklearn.metrics import roc_auc_score from sklearn.metrics import classification_report print("---Base Model---") base_roc_auc = roc_auc_score(y_test, base_rate_model(X_test)) print("Base Rate AUC = %2.2f" % base_roc_auc) print(classification_report(y_test, base_rate_model(X_test))) print("---Logistic Model---") logit_roc_auc = roc_auc_score(y_test, y_pred) print("Logistic Rate AUC = %2.2f" % base_roc_auc) print(classification_report(y_test, y_pred)) #Graphing from sklearn.metrics import roc_curve fpr, tpr, thresholds = roc_curve(y_test, classifier.predict_proba(X_test)[:, 1]) plt.figure() plt.plot(fpr, tpr, label='ROC Curve (area = %0.2f)' % logit_roc_auc) plt.plot([0, 1], [0, 1], 'k--') plt.xlim([0.0, 1.0]) plt.xlim([0.0, 1.05]) plt.xlabel('Flase Positive Rate') plt.ylabel('True Positive Rate') plt.title('Ralationship Between Flase Positive & True Positives') plt.legand(loc='lower right') plt.show()