Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jxareas
GitHub Repository: jxareas/Machine-Learning-Notebooks
Path: blob/master/2_Advanced_Learning_Algorithms/Week 3. Advice for applying machine learning/utils.py
2826 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