jeudi 20 avril 2017

How to solve VisibleDeprecation WARNING

I am using famous iris dataset and want to apply a supervised learning classifier. My problem is i want to apply the classifier on the two column features. And i want to have only two classes instead of three classes. The original dataset has 3 classes and 4 features per sample. When i want to select only two features and remove one class, i am getting the warning as follows:

VisibleDeprecationWarning: boolean index did not match indexed array along dimension 0; dimension is 150 but corresponding boolean dimension is 100

How i can remove this warning?

My code is as follows:

import numpy as np
from sklearn import svm, datasets
iris = datasets.load_iris()
X = iris.data
y = iris.target
X, y = X[y != 2], y[y != 2]
X = iris.data[:, [2, 3]]
X, y = X[y != 2], y[y != 2]
X.shape






Comments
0 Comments

0 commentaires:

Enregistrer un commentaire