K Neighbors Regressor - Arduino

Hello everyone,

Does everyone know if there is a KNN Regressor algortihm for Arduino? I am aware of the KNN classification library, but I need a regressor for prediction purposes.

This is the sample code that I am running in Python, I need to do something similar in Arduino (leaving aside the CSV reading which is less important, I can just manually set the array):

dataset = pd.read_csv('./predictor.csv',header=None)

X_train = dataset.iloc[:, :3]
y_train = dataset.iloc[:, 3:4]

temperature_input = 13.6
humidity_input = 84.72
pressure_input = 1016.5
test_array = (np.array([temperature_input, humidity_input, pressure_input])).reshape(1, -1)

model = neighbors.KNeighborsRegressor(n_neighbors = 3)
model.fit(X_train2, y_train2)  #fit the model

predict = model.predict(test_array)
print("Predicted value is:", predict)

Please let me know if you know a way to add a Regression model. Thanks!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.