This post was translated from the original with AI assistance. Read the original
Reposted from my old CSDN blog: 机器学习笔记(6)——逻辑回归 (written 2018-04-19); formatting tidied during migration.
Logistic Regression#
Logistic regression is a learning algorithm used for supervised learning problems where the output y is always either 0 or 1. The goal of logistic regression is to minimize the error between its predictions and the training data.
Example: cat VS not a cat
Given an image represented by a feature vector x, the algorithm estimates the probability that the picture is a cat.

Parameters used in logistic regression:
- Input feature vector:
, where
is the number of features - Training label:

- Weights:
, where
is the number of features - Threshold:

- Output:

- Sigmoid function:


is a linear function
, and we use the Sigmoid function to keep the probability within [0,1]
From the graph we can see:
- If z is a large positive number, then sigmoid(z) = 1
- If z is a large negative number, then sigmoid(z) = 0
- If z = 0, then sigmoid(z) = 0.5
Comments