application_vnd.jupyter.stderr_output_2.png text_plain_output_1.png
from sklearn.neighbors import KNeighborsClassifier

import numpy as np

import pandas as pd

d = pd.read_excel('/kaggle/input/rice-dataset-commeo-and-osmancik/Rice_Dataset_Commeo_and_Osmancik/Rice_Cammeo_Osmancik.xlsx')
d

from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score
x_train = d[['Area', 'Perimeter', 'Major_Axis_Length', 'Minor_Axis_Length', 'Eccentricity', 'Convex_Area', 'Extent']]
y_train = d['Class']
k = 3
knn = KNeighborsClassifier(n_neighbors=k)
knn.fit(x_train, y_train)
x_test = np.array([[1.2, 1.0, 2.8, 1.2, 1.0, 2.8, 1.2]])
target = knn.predict(x_test)
print(target)