Skip to content

Instantly share code, notes, and snippets.

@wibowotangara
Created January 24, 2024 06:02
Show Gist options
  • Save wibowotangara/efc1c043343c006dd9ec49b408edcca6 to your computer and use it in GitHub Desktop.
Save wibowotangara/efc1c043343c006dd9ec49b408edcca6 to your computer and use it in GitHub Desktop.
KS = max(df_actual_predicted['Cumulative Perc Good'] - df_actual_predicted['Cumulative Perc Bad'])
plt.plot(df_actual_predicted['y_pred_proba'], df_actual_predicted['Cumulative Perc Bad'], color='r')
plt.plot(df_actual_predicted['y_pred_proba'], df_actual_predicted['Cumulative Perc Good'], color='b')
plt.xlabel('Estimated Probability for Being Bad')
plt.ylabel('Cumulative %')
plt.title('Kolmogorov-Smirnov: %0.4f' %KS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment