Question 9
Consider the following code?
from sklearn.neighbors import KNeighborsClassifierimport numpy as np
X_train = np.array([[1, 0.5], [2, 1], [3, 1.5], [4, 2], [5, 2.5], [6, 3], [7, 3.5], [8, 4], [9, 4.5], [10, 5]])
y_train = [0, 0, 1, 1, 2, 2, 2, 2, 2, 2]
knn = KNeighborsClassifier(n_neighbors=7)knn.fit(X_train, y_train)Given a single test data point X_test, what will be the output of the following code?
print(knn.predict(X_test))0
1
2
Can not be determined without knowing the test data point.