K-nearest neighbors¶
Classification¶
| sepal_length | sepal_width | petal_length | petal_width | target | |
|---|---|---|---|---|---|
| 0 | 5.1 | 3.5 | 1.4 | 0.2 | setosa |
| 1 | 4.9 | 3.0 | 1.4 | 0.2 | setosa |
| 2 | 4.7 | 3.2 | 1.3 | 0.2 | setosa |
| 3 | 4.6 | 3.1 | 1.5 | 0.2 | setosa |
| 4 | 5.0 | 3.6 | 1.4 | 0.2 | setosa |
| setosa | versicolor | virginica | |
|---|---|---|---|
| setosa | 10 | 0 | 0 |
| versicolor | 0 | 9 | 0 |
| virginica | 0 | 0 | 11 |
| precision | recall | f1-score | support | |
|---|---|---|---|---|
| setosa | 1.0 | 1.0 | 1.0 | 10.0 |
| versicolor | 1.0 | 1.0 | 1.0 | 9.0 |
| virginica | 1.0 | 1.0 | 1.0 | 11.0 |
| accuracy | 1.0 | 1.0 | 1.0 | 1.0 |
| macro avg | 1.0 | 1.0 | 1.0 | 30.0 |
| weighted avg | 1.0 | 1.0 | 1.0 | 30.0 |