Search results for "Logistic Regression"

logistic_multi_cover

Logistic Regression for Image Classification Using OpenCV

In a previous tutorial, we explored logistic regression as a simple but popular machine learning algorithm for binary classification implemented in the OpenCV library. So far, we have seen how logistic regression may be applied to a custom two-class dataset we have generated ourselves.  In this tutorial, you will learn how the standard logistic regression […]

Continue Reading
logistic_cover

Logistic Regression in OpenCV

Logistic regression is a simple but popular machine learning algorithm for binary classification that uses the logistic, or sigmoid, function at its core. It also comes implemented in the OpenCV library. In this tutorial, you will learn how to apply OpenCV’s logistic regression algorithm, starting with a custom two-class dataset that we will generate ourselves. […]

Continue Reading
y-k-qD2BYEkp3ns-unsplash

Training Logistic Regression with Cross-Entropy Loss in PyTorch

In the previous session of our PyTorch series, we demonstrated how badly initialized weights can impact the accuracy of a classification model when mean square error (MSE) loss is used. We noticed that the model didn’t converge during training and its accuracy was also significantly reduced. In the following, you will see what happens if […]

Continue Reading
manson-yim-O-hXklfVxOo-unsplash

Making Predictions with Logistic Regression in PyTorch

Logistic regression is a statistical technique for modeling the probability of an event. It is often used in machine learning for making predictions. We apply logistic regression when a categorical outcome needs to be predicted. In PyTorch, the construction of logistic regression is similar to that of linear regression. They both applied to linear inputs. […]

Continue Reading
Box and Whisker Plots of L2 Penalty Configuration vs. Accuracy for Multinomial Logistic Regression

Multinomial Logistic Regression With Python

Multinomial logistic regression is an extension of logistic regression that adds native support for multi-class classification problems. Logistic regression, by default, is limited to two-class classification problems. Some extensions like one-vs-rest can allow logistic regression to be used for multi-class classification problems, although they require that the classification problem first be transformed into multiple binary […]

Continue Reading
Scatter Plot of Binary Classification Dataset With 1 to 100 Class Imbalance

Cost-Sensitive Logistic Regression for Imbalanced Classification

Logistic regression does not support imbalanced classification directly. Instead, the training algorithm used to fit the logistic regression model must be modified to take the skewed distribution into account. This can be achieved by specifying a class weighting configuration that is used to influence the amount that logistic regression coefficients are updated during training. The […]

Continue Reading
A Gentle Introduction to Logistic Regression With Maximum Likelihood Estimation

A Gentle Introduction to Logistic Regression With Maximum Likelihood Estimation

Logistic regression is a model for binary classification predictive modeling. The parameters of a logistic regression model can be estimated by the probabilistic framework called maximum likelihood estimation. Under this framework, a probability distribution for the target variable (class label) must be assumed and then a likelihood function defined that calculates the probability of observing […]

Continue Reading
How To Implement Logistic Regression With Stochastic Gradient Descent From Scratch With Python

How To Implement Logistic Regression From Scratch in Python

Logistic regression is the go-to linear classification algorithm for two-class problems. It is easy to implement, easy to understand and gets great results on a wide variety of problems, even when the expectations the method has of your data are violated. In this tutorial, you will discover how to implement logistic regression with stochastic gradient […]

Continue Reading