Making it a binary classification problem

For the sake of simplicity, we want to focus on a binary classification problem for now, where we only have two classes. The easiest way to do this is to discard all data points belonging to a certain class, such as class label 2, by selecting all of the rows that do not belong to class 2:

In [9]: idx = iris.target != 2
... data = iris.data[idx].astype(np.float32)
... target = iris.target[idx].astype(np.float32)

Next, let's inspect the data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.12.34