Enthernet Code
Enthernet Code
DIIDevHeads IoT Integration Server
Created by Enthernet Code on 6/25/2024 in #middleware-and-os
How can I use the machine learning library MicroML to perform simple inference on an ESP32?
Hello guys, how can I use the machine learning library MicroML to perform simple inference on an ESP32? My goal is to predict a simple numerical outcome based on a set of sensor readings, I was able to generate the c code prediction but unsure on what step to take next can anyone help me
from sklearn.linear_model import LinearRegression
import numpy as np
from micromlgen import port

# Example data
X = np.array([[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7]])
y = np.array([10, 20, 30, 40])

# Train the model
model = LinearRegression().fit(X, y)

# Generate C code for the model
c_code = port(model)
print(c_code)
from sklearn.linear_model import LinearRegression
import numpy as np
from micromlgen import port

# Example data
X = np.array([[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7]])
y = np.array([10, 20, 30, 40])

# Train the model
model = LinearRegression().fit(X, y)

# Generate C code for the model
c_code = port(model)
print(c_code)
@Middleware & OS @Helper
5 replies