ML-Logistic regression

Jaehoon Jang
2 min readSep 16, 2021

--

Sigmoid function & Hypothesis representation

Before this post, our goal was to “somehow” curve our hypothesis function. Well, now’s the time for that “somehow”.

Sigmoid function

The sigmoid function allows us to curve our hypothesis function.

Sigmoid function

Sigmoid converges to 1 when x → ∞, and converges to 0 when x → -∞.

Hypothesis Representation

So we have the tools to manipulate the values to fit into the range of 0 and 1.

Hypothesis representation

We want to change the values of our original linear regression hypothesis, so we apply the sigmoid function g(z).

About the sigmoid function

Why does the sigmoid function look like that? Let’s look at the detailed math.

First, we start from the graph y = exp(x).

The exp(-x) will look like this.

So we can derive these facts:

Now we get the sigmoid function.

So how do we divide the examples and put it into separate classes?

Simple. If the hypothesis function exceeds 0.5, we put it into Class 1, and if the hypothesis function is less than 0.5, we put it into Class 0.

--

--

Jaehoon Jang

Masters in Artificial Intelligence, Korea University, South Korea