In [17]:
from matplotlib.patches import Circle

plt.figure(figsize = (10,10))
plt.subplot(2,1,1)
plt.scatter(X_1_test[:,0], X_1_test[:,1], label = 'class 0', color = 'r')
plt.scatter(X_2_test[:,0], X_2_test[:,1], label = 'class 1', color = 'g')
plt.xlabel('feature 1')
plt.ylabel('feature 2')
plt.title('Original dataset, before classification')
plt.legend()
            

plt.subplot(2,1,2)
for i in range(0,500):
    plt.scatter(X_test[i,0], X_test[i,1],  color = 'r')
    if y_test_sklearn[i] == 1:
        plt.scatter(X_test[i,0], X_test[i,1], color = 'g')
        print('Element from class 0 with index %i , feature1= %f and feature2=%f is misclassified.'%(i, X_test[i,0], X_test[i,1]))
for i in range(500,1000):
    plt.scatter(X_test[i,0], X_test[i,1],  color = 'g')
    if y_test_sklearn[i] == 0:
        plt.scatter(X_test[i,0], X_test[i,1], color = 'r')
        print('Element from class 1 with index %i , feature1= %f and feature2=%f is misclassified.'%(i, X_test[i,0], X_test[i,1]))
                        
    
plt.xlabel('feature 1')
plt.ylabel('feature 2')
plt.title('Dataset when it is classified with sklearn LogisticRegression')
circle1 = plt.Circle((-1.879757,-2.862382), radius=0.22, color = 'r', fill=False)
circle2 = plt.Circle((-2.613556,-1.879211), radius=0.20, color = 'r', fill=False)
circle3 = plt.Circle((-0.667955,-2.092435), radius=0.25, color = 'g', fill=False)

plt.text(-4,-0.8, 'These elements')
plt.text(-4,-1.2, 'are misclassified')
plt.gca().add_patch(circle1)
plt.gca().add_patch(circle2)
plt.gca().add_patch(circle3)


plt.show()
Element from class 0 with index 300 , feature1= -1.879757 and feature2=-2.862382 is misclassified.
Element from class 0 with index 321 , feature1= -2.613556 and feature2=-1.879211 is misclassified.
Element from class 1 with index 579 , feature1= -0.667955 and feature2=-2.092435 is misclassified.