1from sklearn import neighbors, datasets
2iris = datasets.load_iris()
3X, y = iris.data, iris.target
4knn = neighbors.KNeighborsClassifier(n_neighbors=1)
5knn.fit(X, y)
6# What kind of iris has 3cm x 5cm sepal and 4cm x 2cm petal?
7print(iris.target_names[knn.predict([[3, 5, 4, 2]])])
8