In [12]:
y_test = np.zeros((1000,1))
y_test[500:, 0]=1
cm_log_reg  = metrics.confusion_matrix(y_test, y_pred)

cm_log_reg
Out[12]:
array([[498,   2],
       [  1, 499]], dtype=int64)