Search⌘ K
AI Features

A Simple Prediction Machine

Explore how to build a simple prediction machine by understanding input-output processes and linear relationships. Learn to estimate constants from examples and grasp foundational concepts in neural networks, setting the stage for building more complex models.

We'll cover the following...

Build a simple model

Imagine a basic machine that takes a question, does some thinking, and pushes out an answer. We can compare this process to the example from before, where we take input through our eyes, use our brains to analyze the scene, and come to a conclusion about what objects are in that scene. Here’s what this looks like.

Computers don’t really think. They are just glorified calculators. So, let’s use more appropriate words to describe what’s going on.

A computer takes some input, does some calculations, and pops out an output. This is illustrated in the following image. An input of 3×43 \times 4 is processed, perhaps by turning multiplication into an easier set of addition equations, and the output answer 1212 pops out.

We’re using simple and familiar examples here to lay out concepts that will apply to the more interesting neural networks we look at later. Let’s ramp up the complexity just a tiny bit. Let’s imagine a machine that converts kilometers to miles.

Now, imagine we don’t know the formula for converting between kilometers and miles. All we know is the relationship between the two is linear. That means if we double the number in miles, the same distance in kilometers is also doubled.

The linear relationship between kilometers and miles gives us a clue about that mysterious calculation—it needs to be in the form miles\text{miles} =kilometers= \text{kilometers} \cdot cc, where cc is a constant. We don’t know its value yet.

The only clues we have are some examples pairing kilometers with the correct value for miles. These are like real-world observations used to test scientific theories.

Truth Example Kilometres Miles
1 0 0
2 100 62.137

So, how do we estimate the missing constant cc by using the two examples given in the table? Let’s find out!