官术网_书友最值得收藏!

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 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)
主站蜘蛛池模板: 镇远县| 永和县| 乌审旗| 唐海县| 乾安县| 皮山县| 奎屯市| 海宁市| 深州市| 霞浦县| 贵定县| 师宗县| 且末县| 阿荣旗| 青阳县| 博白县| 雷山县| 绥滨县| 嘉定区| 襄樊市| 林周县| 广宁县| 张北县| 佛山市| 安图县| 阜新市| 秦安县| 上思县| 武川县| 陵川县| 房山区| 嘉黎县| 隆回县| 莒南县| 渭南市| 临安市| 德惠市| 阿拉善右旗| 江源县| 永福县| 潼关县|