# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---



# +
import numpy as np
import matplotlib.pyplot as plt
# %matplotlib inline

X = np.random.rand(100,3)
data = 2

if data==1:
    X[:,2] = ((X[:,0]+2*X[:,1]+0.5*np.random.randn(X.shape[0]))>1.2).astype(int)
if data==0:
    X[:,2] = (np.abs(X[:,0]+2*X[:,1]-1.7)>0.5).astype(int)
if data==2:
    nX = X+np.random.randn(X.shape[0],3)*0.1
    X[:,2] = 1
    X[(nX[:,0]>0.5) & (nX[:,1]>0.5),2]=0
    X[(nX[:,0]<0.5) & (nX[:,1]<0.5),2]=0
    
    
plt.plot(X[X[:,2]==0,0],X[X[:,2]==0,1],'xr')
plt.plot(X[X[:,2]==1,0],X[X[:,2]==1,1],'ob')        
# -

np.set_printoptions(precision=2,suppress=True)
X



StarcoderdataJupyterScriptsDedupFiltered