How are the value creating the graph in logistic regression?

  • Week 3 Practice Lab

  • So far we calculated w,b and mapped_x with 27 features. I understand the calculations but don’t quite get how those values are being represented in the graph attached below. I would really appreciate if someone could explain how we got to the graph from w and b.

1 Like

Hi @AbheeshK

When we map the X, it means that we use polynomial features, radial basis functions, or other non-linear transformations to capture more complex relationships in the data. By using feature mapping, the non-linear relationships in the original space become linear in the transformed feature space. The classifier finds a linear decision boundary in this transformed space, which when projected back to the original space, appears as a non-linear boundary

For linear classifiers, a decision boundary is defined by the equation: W^Tx + b = 0

So, when the equation is greater than zero it indicates that the data point belongs to one class. And, when the the equation is less than zero it x belongs to the other class.

Hope this helps, feel free to ask if you need further assistance!


I totally agree with the reply from @Alireza_Saei.

In addition, there is another mathematically equivalent way to look at the boundary, using the logistic sigmoid() activation.

The output of sigmoid(z) ranges from 0 to 1, for real inputs from -Inf to +Inf.

0.0 maps to False, and 1.0 maps to True.

We make classification predictions based on the midpoint between 0 and 1, at a threshold of 0.5. This occurs when z = 0.

if we let z equal the linear model (w*x + b), then the boundary is the set of all points where sigmoid(z) = 0.5.


Thanks for the help! However, I won’t lie that I did not understand a lot of the terms you wrote. I still have a lot of maths to learn

1 Like

Thanks a lot Mosh! That cleared it up

1 Like

Oh, feel free to ask about any terms or concepts you didn’t understand!

When we “map the X,” it means we’re changing our data in a way that makes it easier to find patterns. We use methods like polynomial features or radial basis functions to do this.

Let me put it this way, our original data might have relationships that are curved or complex, and it’s hard to draw a straight line to separate the classes (categories). By transforming the data, we make these relationships look more like straight lines in the new space.

I hope this simpler explanation helps!

1 Like