Motor control with Classification Model

Iam trying to classify EMG and IMU signals to predict the motion of our leg. So i want to control a stepper and servo to replicate the leg movements.

I need help with coding that stuff. How do we code stepper and servo with the prediction as an input to control it.
For eg: if the model predicts the movement as walking, the arduino should control the motors respectively.

Hi @Mr.Smart,

Please see this tutorial to get started using classification inference results.

The model will output a series of prediction values corresponding to each of the classes. For example, you might feed raw data into the model and get 3 output values, each corresponding to the confidence score of running, standing, walking, respectively.

To use the output values, you need to find which of those values is the highest. For example, you might see:

Predictions:
  running: 0.01
  standing: 0.02
  walking: 0.97

Because walking has the highest score, you can assume that the model believes the data belongs to the “walking” class.