Predict the Future with Regression Models

Since the launch of Edge Impulse developers have been able to use sensor data to make sense of the real world through classification ('which one of these states is happening right now') and anomaly detection ('is what's happening out of the ordinary') models. Today, we also add the ability to predict scalar values through the new regression learning block. With the new regression block you can predict the future ('what will the temperature be 60 minutes from now?') and solve problems that don't fit into set classes ('how much water is flowing through a pipe?').

This is a companion discussion topic for the original entry at

Thank you for the information. However, I have been stacked with this and I do have two questions;

  1. How to deal with duplicate labels?
  2. How to deal with float values for labels such 1.23?

Hi @josephsoso

  1. Duplicate labels are fine, e.g. predicting pipe flow from audio, you’ll probably have many samples with the same label. The more data the better.
  2. Right now you can either set it in the UI (three dots next to sample => edit label). Just separate with decimal part .. To upload the data quickly you can build a script and use the CLI, e.g.:
edge-impulse-uploader --label 1.23 1.13.json


Thank you so much, let me try it and see.

1 Like

When i use this regression model, error message ’ Not all labels are numeric, this is required for regression models’. How to solve this problem.

Hi @AziziMizan,

The labels for each of the data samples must be a numerical value (integer or floating point number) for regression to work. In the example given, you can see how the “label” field is a number:

In this demo, the label is actually the ground-truth temperature value measured 60 minutes after the data sample was taken. You train the model to predict that value (given on the label) so that you can estimate temperatures in the future.

Hope that helps!

1 Like

@shawn_edgeimpulse, in fact I faced the same issue and realized that the Label field should be “strings”. At least was what I saw downloading the notebook from this example:
classes_values = [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60" ]
classes = len(classes_values)

In my case, I had 22 scalar values (int64) and so, I first converted them previously to upload data to Studio as Json:

y_train = np.char.mod('%d', y_train)
y_test = np.char.mod('%d', y_test)

Make sense?

@mjrovai Ah! Good catch. Thank you :grinning: