Search⌘ K
AI Features

Model

Explore how a perceptron model represents data classification by using weighted inputs and activation functions to create decision boundaries. Understand the mathematical foundation behind how models separate data classes and prepare to implement your first perceptron in code.

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.

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.

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 ...

...