Learning Blocks
Regression
A neural network that predicts a number, such as a speed or an angle, instead of a label.
Try it in StudioOn this page
What is this learning block?
Regression predicts a number for each window. In Studio it appears as Regression in the Add a learning block list. It uses the same hidden layers as Classification, but its output is a single number.
What does it do?
Instead of "this window is a wave", it says "this window has a value of 1.42". For example, it can estimate how fast someone is pedalling, or how strongly a machine vibrates.
How does it learn?
Your labels are the targets, so every label name must be a number, such as 0.5, 1 or 12.3. The model guesses a number for each training window, measures how far off it was, and adjusts its weights to reduce that error (Adam optimizer). Training stops early if the validation loss stops improving for 20 training cycles, and the best version is kept.
What model architecture does it use?
- 1InputFeatures of one window
- 2Dense 128+ batch normalisation + dropout 0.3
- 3Dense 64+ batch normalisation + dropout 0.3
- 4OutputOne number
You can change the hidden layers in the architecture editor on the training page.
What settings can I configure?
| Setting | Default | What it does |
|---|---|---|
| Training cycles | 60 | Passes over the training data |
| Learning rate | 0.001 | Size of each weight adjustment |
| Processor | CPU | Where training runs (GPU only if your server offers it) |
| Batch size (Advanced Settings) | 32 | Windows per weight adjustment |
| Validation split (Advanced Settings) | 0.2 | Share of training data kept aside to check progress |
An impulse with a Regression block can't also contain Classification, 1D Convolutional or 2D Convolutional.
What problems can it solve?
- Estimating a speed, rate or intensity from movement.
- Estimating a tilt angle from an accelerometer.
- Any task where the answer is a measurement, not a category.
Simple example
You record a fan running at three speeds and label the recordings 1, 2 and 3, using Spectral Analysis. After training, a new recording at speed 2 gives predictions around 2.1 for each window. The MAE of 0.1 means predictions are off by 0.1 on average.
How do I understand the training results?
- MAE (mean absolute error): the average distance between prediction and target, in the same units as your labels. Lower is better.
- RMSE (root mean squared error): like MAE, but large mistakes count more. Lower is better.
- R²: how much of the variation in the targets the model explains. 1 is perfect; 0 means no better than always guessing the average.
- Training graphs show MAE for training and validation over the training cycles. They should both go down.
There is no confusion matrix, because there are no classes.