LearnPy Hub
← Machine Learning: scikit-learn problems
Medium

Which Iris Is It?

Train KNeighborsClassifier(n_neighbors=5) on all 150 iris flowers. Read the four measurements of a new flower and print the name of its predicted species.

Input

Four decimal numbers: sepal length, sepal width, petal length, petal width (cm).

Output

setosa, versicolor or virginica.

Sample 1

Input
5.0 3.4 1.5 0.2
Output
setosa

Sample 2

Input
6.0 2.9 4.5 1.5
Output
versicolor
solution.py
Output appears here
Hints
Which Iris Is It? · Python practice problem · LearnPy Hub