In [ ]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np

In [ ]:
xs = np.random.rand(100, 2) - 0.5
pos_class = [(x,y) for x,y in xs if x*(y+0.1*np.sign(x)) > 0 ]
neg_class = [(x,y) for x,y in xs if x*(y+0.1*np.sign(x)) < 0 ]

In [ ]:
for points in [pos_class, neg_class]:
    xs = [x for x,y in points]
    ys = [y for x,y in points]
    plt.scatter(xs, ys)
plt.tick_params(labelright=True)

In [ ]:
for points in [pos_class, neg_class]:
    xs = [x for x,y in points]
    ys = [y for x,y in points]
    plt.scatter(xs, ys)
plt.axvline(color='k', linewidth=3)
plt.tick_params(labelright=True)

In [ ]:
for points in [pos_class, neg_class]:
    xs = [x for x,y in points]
    ys = [y for x,y in points]
    plt.scatter(xs, ys)
plt.axvline(color='k', linewidth=3)
plt.axhline(color='k', linewidth=3, y=0.1, xmin=-0.5, xmax=0.5)
plt.axhline(color='k', linewidth=3, y=-0.1, xmin=0.51, xmax=1)
plt.tick_params(labelright=True)

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]: