- Logistic Regression

Logistic regression example using scikit-learn.

We'll cover the following

Logistic regression is a supervised classification algorithm that is useful for predicting which users are likely to perform an action, such as purchasing a product. Using scikit-learn, the process is similar to fitting a linear regression model.

Example

The main differences from the prior script are the dataset being used, the model object instantiated (LogisticRegression), and the predict_proba function used to calculate error metrics. . This function predicts a probability in the continuous range of [0,1][0,1] rather than a specific label.

The snippet below predicts which users are likely to purchase a specific game based on prior games already purchased:

Get hands-on with 1400+ tech skills courses.