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

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)
主站蜘蛛池模板: 汤阴县| 巴中市| 东乡| 永修县| 永康市| 新兴县| 惠安县| 任丘市| 阳泉市| 五峰| 南陵县| 金堂县| 翁牛特旗| 漯河市| 湘西| 巴彦淖尔市| 淮阳县| 临潭县| 米易县| 营山县| 长宁县| 习水县| 贵阳市| 余干县| 鄂温| 海林市| 菏泽市| 武鸣县| 紫阳县| 丽水市| 上犹县| 横山县| 安西县| 永安市| 苍南县| 河北区| 沙河市| 广宁县| 文成县| 兴安县| 兴和县|