I don't know why this code doesn't work?
training_data_X = np.array([ [1.2, 6.7, 2.7], [2.3, 4.6, 2.2], [0.3, 3.9, 0.8], [2.1, 1.3, 4.3] ])
training_scores_Y = np.array( [1.4, 9.2, 2.5, 2.2] )
y_test = np.array([ [1.2, 6.7, 2.7], [7.6, 7.2, 0.2] ])
knn = KNeighborsClassifier(n_neighbors=1)
knn.fit(training_data_X, training_scores_Y)
y_pred = knn.predict(y_test)
print(y_pred)
I got this error:
ValueError: Unknown label type: 'continuous'
Thank you for your help.
You have used the KNN Classifier whereas your problem is regression.
You can KNN Regressor https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsRegressor.html