Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
greyhatguy007
GitHub Repository: greyhatguy007/Machine-Learning-Specialization-Coursera
Path: blob/main/C2 - Advanced Learning Algorithms/week3/C2W3A1/utils.py
3520 views
1
import numpy as np
2
from sklearn import datasets
3
4
5
def load_data():
6
iris = datasets.load_iris()
7
X = iris.data[:, :2] # we only take the first two features.
8
y = iris.target
9
10
X = X[y != 2] # only two classes
11
y = y[y != 2]
12
return X, y
13