Neural Network Regression

See how a computer learns to predict numbers. Start by guessing house prices, add more clues and watch the mistakes shrink. Then try curved, non-linear patterns from real life (fuel use by speed, temperature through the year, plant growth) and compare the neural network with a classic straight line. Every setting has a short explanation, and everything runs in your browser.

Learn step by step · 1 of 10

Guess the price of a house

Each blue dot is a house that was sold. The further right, the bigger the house. The higher up, the more it cost.

We'll teach the computer to guess a house's price from its size. Guessing a number like this is called regression.

Try this

Press Start. The green line is the computer's guess for every size. Watch it move to fit the dots.

Neural Network

Regression

Predict a number from examples

Epochs
0
Training mistake
–
Test mistake
–
Average mistake
–
Within 10%
–

Data

200 made-up houses that follow real-life patterns.

Clues (features)

What the computer knows about each house. Size is always on because it's along the bottom of the chart.

The model

Layers with neurons

InOut

No hidden layers: the model can only learn a straight line. Press + to add one.

Tanh: makes smooth, gentle bends.

Training

0.0030

How big each learning step is. Too small: slow. Too big: it overshoots.

8

How many examples it looks at before each correction.

The basic step: move each weight a little against its error.

Ready
Learning dataTest data (never seen)Neural network

Mistakes over time

TrainingTest

Press Start to see how the mistakes shrink

What the computer learned

Press Start to see how much each clue adds to the price.

Your experiments

Train, then change the clues. Each run's average mistake is saved here so you can compare. Shorter bar = better.

How to use the Neural Network Regression

  1. 1

    Follow the lesson

    Ten short steps explain predictions, clues (features), curves, neurons, step size, optimisers and overfitting.

  2. 2

    Pick an example

    House prices, car speed vs fuel use, temperature through the year, plant growth, or a custom shape you can draw on.

  3. 3

    Build the network

    Add layers, type the number of neurons, and choose the activation, learning rate, batch size and optimiser.

  4. 4

    Press Start and compare

    Watch the green curve bend to fit the points, next to the dashed straight line of classic linear regression.

Features

  • Linear vs non-linear

    See a straight line and a neural network side by side, with both test mistakes.

  • House price prediction

    Add clues like size, age and distance and watch the average mistake fall in dollars.

  • Real-life curves

    U-shapes, waves and S-curves with real units, like km/h, °C and cm.

  • 7 optimisers

    SGD, Momentum, AdaGrad, RMSProp, AdaDelta, Adam and Adamax.

  • Live mistakes chart

    Training and test mistakes (MSE) plotted as the model learns.

  • Made for beginners

    A guided lesson in plain words, and a hint under every setting.

Frequently asked questions

What is regression in machine learning?

Regression means predicting a number, like the price of a house or tomorrow's temperature. The model learns from examples where the answer is known, then predicts the number for new ones.

What is the difference between linear and non-linear regression?

Linear regression can only draw a straight line, so it misses patterns that bend, like fuel use being highest at very low and very high speeds. A neural network with hidden layers can bend its line to follow the pattern: that's non-linear regression. Turn on "Compare with a straight line" to see both.

How do more features make predictions more accurate?

In the house price example the model first knows only the size, and its average mistake is about $33k. Add bedrooms, age, distance and garden and it drops to about $20k, because it can now tell apart houses of the same size. A useless clue like door colour doesn't help.

What is MSE?

MSE (mean squared error) is the average of the squared mistakes. It's always zero or more, and lower is better. The test MSE uses examples the model never trained on.

What is overfitting?

Overfitting is when a model learns the training examples by heart instead of the real trend. The curve wiggles through every training point, and the test mistake stays high even as the training mistake falls.

Is there a classification version?

Yes. The Neural Network Classification simulator sorts points into groups instead of predicting numbers.

More free tools