July 2017
Intermediate to advanced
382 pages
9h 13m
English
As we can now recite in our sleep, a binary classification problem has exactly two distinct target labels (n_classes=2). For the sake of simplicity, let's limit ourselves to only two feature values (n_features=2; for example, an x and a y value). Let's say we want to create 100 data samples:
In [1]: from sklearn import datasets... X, y = datasets.make_classification(n_samples=100, n_features=2,... n_redundant=0, n_classes=2,... random_state=7816)
We expect X to have 100 rows (data samples) and two columns (features), whereas the vector y should have a single column that contains all the target labels:
In [2]: X.shape, y.shapeOut[2]: ((100, 2), (100,))
Read now
Unlock full access