Book Image

Data Science for Marketing Analytics

By : Tommy Blanchard, Debasish Behera, Pranshu Bhatnagar
Book Image

Data Science for Marketing Analytics

By: Tommy Blanchard, Debasish Behera, Pranshu Bhatnagar

Overview of this book

Data Science for Marketing Analytics covers every stage of data analytics, from working with a raw dataset to segmenting a population and modeling different parts of the population based on the segments. The book starts by teaching you how to use Python libraries, such as pandas and Matplotlib, to read data from Python, manipulate it, and create plots, using both categorical and continuous variables. Then, you'll learn how to segment a population into groups and use different clustering techniques to evaluate customer segmentation. As you make your way through the chapters, you'll explore ways to evaluate and select the best segmentation approach, and go on to create a linear regression model on customer value data to predict lifetime value. In the concluding chapters, you'll gain an understanding of regression techniques and tools for evaluating regression models, and explore ways to predict customer choice using classification algorithms. Finally, you'll apply these techniques to create a churn model for modeling customer product choices. By the end of this book, you will be able to build your own marketing reporting and interactive dashboard solutions.
Table of Contents (12 chapters)
Data Science for Marketing Analytics
Preface

Understanding Logistic Regression


Logistic regression is one of the most widely used classification methods, and it works well when data is linearly separable. The objective of logistic regression is to squash the output of linear regression to classes 0 and 1.

Revisiting Linear Regression

In the case of linear regression, our function would be as follows:

Figure 7.2: Equation of linear regression

Here, x refers to the input data, y is the target variable, and θ0 and θ1 are parameters that are learned from the training data.

Also, the cost function in case of linear regression, which is to be minimized is as follows:

Figure 7.3: Linear regression cost function

This works well for continuous data, but the problem arises when we have a target variable that is categorical, such as, 0 or 1. When we try to use linear regression to predict the target variable, we can get a value anywhere between −∞ to +∞, which is not what we need.

Logistic Regression

If a response variable has binary values, the assumptions...