Model

Learn about our first machine learning model, the perceptron, which is inspired by a single neuron in our brain.

The ML process

For any complex problem that requires the computer to be able to identify patterns, there is an ML process to solve it.

Press + to interact
Machine learning pipeline
Machine learning pipeline

This chapter demystifies each step of this process one by one. This lesson is about the second step—the model.

We have seen how a linear decision boundary geometrically separates the movie dataset into two regions. The region on one side of the line represents the “Good” movies class while that on the other side of the line shows the “Bad” movies class.

Press + to interact
Linear boundary
Linear boundary

However, mathematically speaking, how do we determine if a point is on the good side or the bad side of a given line? Let’s look at how a line is represented mathematically.

Detour: Math behind the line

Any line in the 2D coordinate plane, including the one shown in the plot above, can be represented by the following general equation,

Here aa, bb and cc are constants, whereas x1x_1and x2x_2 represent values of the coordinate axes.

Let’s play around with the values of aa and bb to see how they affect the visual representation of a line in the 2D plane. Try changing the values of aa and bb using the slider and find out what effect it has on the line:

This shows that both aa and bb determine the rotation of the line.

But what about the constant cc? Let’s play with the value of cc using the slider and find out what effect it has on the line:

We can see that cc does not rotate the line, rather it moves the line.

Together, rotating and moving the line can place it anywhere in 2D space and create a decision boundary.

Choosing the right decision boundary

What has the above ...