We have discussed the basic ideas of logistic regression in previous post. The purpose of logistic regression is to find the optimal decision boundary which can classify the data with different categorical target feature into different classes. We also introduced the logistic function or sigmoid function as the regression model to find the optimal decision boundary. Now let’s take a look how to achieve it. Cost Function and Gradient Descent for Logistic Regression We can still use gradient descent to train the logistic regression model.
In previous series of posts we discussed [simple and multivariate linear regression]() that can be used to predict target features with continuous values. Besides that, there are other prediction problems with categorical target features and we want to train a model so that we can use it to predict the class of unknown data. Logistic regression is one of these models. Classification Problem Imagine we have a tumor dataset which contains the Size of tumor and whether the tumor is Malignant or not.