Tuesday, August 15, 2017

plot a ROC curve

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator

#plt.switch_backend('agg')

dt = pd.read_csv('cs_2017_roc_gain.csv', sep=",", header=0)
fig = plt.gcf()
plt.plot(dt.x_gain * 100.0, dt.y * 100.0)
plt.xlim([0, 100])
plt.ylim([0, 100])
ax = fig.gca()
ax.set_xticks(np.arange(0, 101, 10))
ax.set_yticks(np.arange(0, 101, 10))

minor_locator = AutoMinorLocator(2)
ax.xaxis.set_minor_locator(minor_locator)
ax.yaxis.set_minor_locator(minor_locator)

ax.set_xlabel(r'% of Transactions')
ax.set_ylabel(r'% of Chargeoff Accounts')
fig.suptitle('Consumer')
#ax.minorticks_off()
plt.grid(which='minor')
plt.grid(which='major')

plt.show()
fig.savefig('Consumer_2017.jpg', dpi=300)

print dt.head()

No comments:

Post a Comment

Any comments?

my-alpine and docker-compose.yml

 ``` version: '1' services:     man:       build: .       image: my-alpine:latest   ```  Dockerfile: ``` FROM alpine:latest ENV PYTH...