Skip to content

Instantly share code, notes, and snippets.

@ghodsizadeh
Last active March 24, 2020 13:29
Show Gist options
  • Save ghodsizadeh/4ea7ce637447d4804010318706da8f3e to your computer and use it in GitHub Desktop.
Save ghodsizadeh/4ea7ce637447d4804010318706da8f3e to your computer and use it in GitHub Desktop.
from sklearn import datasets
iris = datasets.load_iris()
X = iris.data[:,[2,3]] # just get two features of iris dataset, to plot decision boundry
y = iris.target
print('Class Labels', np.unique(y))
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size =0.3, random_state =1, stratify =y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment