
This section will explain you what this course covers. The table of contents and objectives of the course.
Also, it will demonstrate the different applications and setup requirements need to be installed before you proceed with the course.
In this section you will be familiarized with the topic that will be covered in this lesson. It covers basic data preparation and manipulation techniques in Python, which is the foundation of data science.
In this section you will learn the following:
Data Types
Traditional Marketing Analytics Model
Marketing Analytics Using Python
Pandas is a software library written in Python and is the basis for data manipulation and analysis in the language. Its name comes from "panel data," an econometrics term for datasets that include observations over multiple time periods for the same individuals.
In this section you will learn the following:
Pandas and its DataFrame
Importing and exporting data with Pandas DataFrames
Importing JSON files into Pandas
Identifying Semi-Structured and Unstructured Data
Structure of a Panda Series
Pandas DataFrame
Now that we have deconstructed the structure of the pandas DataFrame down to its basics, the rest of the wrangling tasks, that is, creating new DataFrames, selecting or slicing a DataFrame into its parts, filtering DataFrames for some values, joining different DataFrames, and so on, will become very intuitive.
In this section you will learn the following:
Selecting and Filtering in Pandas
Creating Test DataFrames in Python
Adding and Removing Attributed and Observations
Creating and Modifying Test DataFrames
Combining Data
Handling Missing Data
Combining DataFrames and Handling Missing Values
Applying Functions and Operations on DataFrames
Operation on Pandas DataFrames
Grouping Data
Applying Data Transformations
This section will summarize the topics covered in this lesson.
This lesson covers the techniques to explore and analyze data by means of solving some problems critical for businesses, such as identifying attributes useful for marketing, analyzing key performance indicators, performing comparative analyses, and generating insights and visualizations.
We will use the pandas, Matplotlib, and seaborn libraries in Python to solve these problems. It will cover the objectives and topics that will be explained.
Before we start with the model creation, we should summarize the attributes in our data and objectively compare them with our business expectations. To quantify business expectations, we generally have target metrics whose relationships we want to analyze with the attributes in our data. These metrics may depend on domain knowledge and business acumen and are known as Key Performance Indicators (KPIs).
In this section you will learn the following:
Traditional Marketing Analytics Model
Exploring the Attributes in Sales Data
Once we have identified the KPIs for our analysis, we can proceed to make insights with respect to only those variables that affect the bottom line of the KPIs.
In this section, you will learn the following:
Selecting and Renaming Attributes
Transforming Values
Targeting Insights for Specific Use Cases
Reshaping the Data
Understanding and Stacking and Unstacking
Pivot Tables
An important aspect of exploring data is to be able to represent the data visually.
When data is represented visually, the underlying numbers and distribution become very easy to understand and differences become easy to spot.
In this section, you will learn the following:
Plots
Visualizing Data with Pandas
Visualizing with Seaborn
Visualizing through Seaborn
Visualization with Matplotlib
This section will summarize the topics covered in this lesson.
This lesson covers various customer segmentation methods, deals with the concepts of similarity and data standardization, and explains k-means clustering.
Customer segmentation is the act of separating your target customers into different groups based on demographic or behavioral data so that marketing strategies can be tailored more specifically to each group.
In this section you will learn to do the following:
Customer Segmentation Methods
Traditional Segmentation Methods
Unsupervised Learning (Clustering) for Customer Segmentation
For a clustering algorithm to try to find groups of customers, they need some measure of what it means for a customer to be similar or different.
In this section, we will learn how to think about how similar two data points are and how to standardize data to prepare it for clustering.
In this section you will learn to do the following:
Determining Similarity
Standardizing Data
Standardizing Age and Income Data for Costumers
Calculating Distance
Calculating Distance Between Three Customers
k-means clustering is a very common unsupervised learning technique with a very wide range of applications. It is powerful because it is conceptually relatively simple, scales to very large datasets, and tends to work quite well in practice.
You will learn the conceptual foundations of k-means clustering, how to apply k-means clustering to data, and how to deal with high-dimensional data (that is, data with many different variables) in the context of clustering.
In this section you will learn to do the following:
Understanding k-means Clustering
K-means Clustering on Income/Age Data
High-Dimensional Data
Visualizing through Seaborn
This section will summarize the topics covered in this lesson.
This lesson covers various clustering algorithms (apart from k-means) and explains how they can be evaluated. It will cover the objectives and topics that will be explained.
In the previous lesson, we just used a predefined number of clusters, but in the real world, we don’t always know what number of clusters to expect. There are different ways of trying to come up with the correct number of clusters.
In this section you will learn the following:
Choosing the Number of Clusters
Simple Visual Inspection
Choosing the Number of Clusters Based on Visual Inspection
Elbow Method with Sum of Squared Errors
Determining the Number of Clusters Using the Elbow Method
k-means is a useful clustering algorithm because it is simple, widely applicable, and scales very well to large datasets. However, it is not the only clustering algorithm available. Each clustering algorithm has its own strengths and weaknesses, so it’s often worth having more than one in your toolkit. We will look at some of the other popular clustering algorithms in this section.
In this section, you will learn the following:
Mean-Shift Clustering
Performing Mean-Shift Clustering to Cluster Data
K-Prototypes and k-Modes Clustering
Clustering Data Using the k-prototypes Method
Being able to perform clustering in different ways is only useful if you know how to evaluate different clustering methods and compare them in an objective way.
Subjective methods, such as visual inspection, can always be used, but the silhouette score is a powerful objective method that can be used with data that is more difficult to visualize..
In this section, you will learn the following:
Silhouette Score
Calculating Silhouette Score and Comparing to the Mean-Shift Algorithm
Train and Test Split
Using a Train-Test Split to Evaluate Clustering Performance
This section will summarize the topics covered in this lesson.
In this lesson, you will learn about regression, a supervised learning technique used to predict continuous outcomes. We will begin with an explanation of regression. Then, we will discuss feature engineering and data cleaning for regression. Finally, we will learn how to perform regression and interpret the results.
Feature engineering is the process of taking data and transforming it for use in predictions. The idea is to create features that capture aspects of what's important to the outcome of interest. This process requires both data expertise and domain knowledge—you need to know what can be done with the data that you have, as well as knowledge of what might be predictive of the outcome, you're interested in. We will first look at how to transform data to create features, and then how to clean the data of the resulting features to ensure models are trained on high-quality data.
In this section you will learn the following:
Feature Engineering for Regression
Feature Creation
Data Cleaning
Creating Features for Transaction Data
Assessing Features Using Visualization and Corelations
Assessing Corelations
Examining Relationships between Predictors and Outcome
Linear regression is a type of regression model that uses linear relationships between predictors and the outcome to predict the outcome.
In this section, you will learn the following:
Regression Hierarchy
Linear
Building a Linear Model Predicting Customer Spend
This section will summarize the topics covered in this lesson.
This lesson covers other regression techniques such as lasso regression and explains how to evaluate various regression models using common measures of accuracy.
In order to evaluate regression models, we first need to define some metrics.
The common metrics used to evaluate regression models rely on the concepts of residuals and errors, which are quantifications of how much a model mispredicts a particular data point.
In this section you will learn the following:
Residuals and Errors
Mean Absolute Error
Root Mean Squared Error
Evaluating Regression Models of Location Revenue MAE and RMSE
In the previous section, we saw how an evaluation metric such as the RMSE can be used to decide whether a variable should be included in a model or not. However, this method can be cumbersome when there are many variables involved. One common way to select which features will be used by a model is to use regularization.
In this section, you will learn the following Pain Points:
Using Regularization for Feature Selection
Using Lasso Regression for Feature Selection
Linear models are not the only type of regression models. Another powerful technique is to use regression trees.
In this section you will learn the following:
Tree Based Regression Models
Random Forests
Using Tree Base Regression Models to Capture Non-Linear Trends
This section will summarize the topics covered in this lesson.
Churn prediction is one of the most common use cases of machine learning.Predicting customer churn is important for an organization because acquiring new customers is easy, but retaining them is more difficult.
Similarly, high employee churn can also affect a company, since it spends a huge sum of money on grooming talent. Also, organizations that have high retention rates benefit from consistent growth, which can also lead to high referrals from existing customers.
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.
In this section you will learn the following:
Classification Problems
Workflow of a Supervised Classification Task
Types of Classification Problems
Revisiting Linear Regression
Logistic Regression
Plotting the Sigmoid Function
Cost Function for Logistic Regression
Loading, Splitting, and Applying Linear and Logistic Regression
Logistic OSEMN is one of the most common data science pipelines used for approaching any kind of data science problem. It's pronounced awesome.
In this section you will learn the following:
Using Regularization for Feature Selection
Obtaining the Data
Imputing Missing Values
Remaining Columns and Changing the Data Type
Exploring the Data
Statistical Overview
Corelation
Obtaining the Statistical Overview and Corelation Plot
Visualizing the Data
Performing Exploratory Data Analysis (EDA)
Modeling the data not only includes building your machine learning model but also selecting important features/columns that will go into your model. This section will be divided into two parts: Feature Selection and Model building.
In this section you will learn the following:
Feature Selection
Methods of Feature Selection
Performing Feature Selection
Model Building
Building a Logistic Regression Model
Interpreting the Data
This section will summarize the topics covered in this lesson.
This lesson will cover how to evaluate the performance of the various models and choose the most appropriate one. Choosing an appropriate machine learning model is an art that requires experience, and each algorithm has its own advantages and disadvantages.
When dealing with data that is linearly separable, the goal of the Support Vector Machine (SVM) learning algorithm is to find the boundary between classes so that there are fewer misclassification errors.
In this section you will learn the following:
Support Vector Machines
Advantages and Disadvantages of SVM
Intuition Behind Maximum Margin
Linearly Inseparable Cases
Linearly Inseparable Cases Using Kernel
Training an SVM Algorithm over a Dataset
There Decision trees are mostly used for classification tasks. They are a non-parametric form of supervised learning method. Decision trees work on the concept of finding out the target variable by learning simple decision rules from data. They can be used for both classification and regression tasks.
In this section, you will learn the following:
Decision Trees
Advantages and Disadvantages of Decision Trees
Implementing a Decision Tree Algorithm Over a Dataset
Important Terminology of Decision Trees
Decision Tree Algorithm Formulation
Information Gain
Gini Impurity
Entropy
Misclassification Error
Random Forest
Random Forest Algorithm
Advantages and Disadvantages of Random Forest
Implementing a Random Forest Model Over a Dataset
Preprocessing data before applying any machine learning model can improve the accuracy of the model to a large extent. Therefore, it is important to preprocess data before applying a machine learning algorithm.
In this section you will learn the following:
Pre-processing Data
Standardization
Standardizing Data
Scaling
Scaling Data after Feature Selection
Normalization
Performing Normalization on Data
Model Evaluation
Implementing Stratified k-fold
Fine Tuning of the Model
In the case of classification algorithms, we use a confusion matrix, which gives us the performance of the learning algorithm. It is a square matrix that counts the number of true positive (TP), true negative (TN), false positive (FP), and false negative (FN) outcomes.
In this section you will learn the following:
Confusion Matrix
Evaluating the Performance Metrics for a Model
ROC Curve
Plotting the ROC Curve
This section will summarize the topics covered in this lesson.
In this lesson, you will start by exploring multiclass classification. Then, you will deep dive into the intuition behind multiclass classification problems and see how to tackle class-imbalanced data. Finally, you will create a multiclass classification classifier.
The classification algorithms that we discussed earlier were mostly binary classifiers, where the target variable can have only two categorical values or classes.
However, there can be scenarios where we have more than two classes to classify samples into. For instance, given data on customer transactions, the marketing team may be tasked with identifying the credit card product most suitable for a customer, such as cashback, air miles, gas station, or shopping.
In this section you will learn the following:
Multiclass Classification
Classifiers in Multiclass Classification
Implementing a Multiclass Classification Algorithm on a Dataset
Performance Metrics – Micro Average
Evaluating Performance Using Multiclass Performance Metrics
Class imbalance is the most common problem that a data scientist can encounter.
Most real-world classification tasks involve classifying data, where one class or multiple classes are over-represented. This is called class imbalance. Common examples where class-imbalanced data is encountered is in fraud detection, anti money laundering, spam detection, and cancer detection.
In this section, you will learn the following:
Performing Classification on Imbalanced Data
Dealing with Class Imbalanced Data
Visualizing Sampling Techniques
Fitting a Random Forest Classifier Using SMOTE and Building the Confusion Matrix
This section will summarize the topics covered in this lesson.
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 course 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 course, you will be able to build your own marketing reporting and interactive dashboard solutions.
About the Author
Tommy Blanchard earned his Ph.D. from the University of Rochester and did his postdoctoral training at Harvard. Now, he leads the data science team at Fresenius Medical Care North America. His team performs advanced analytics and creates predictive models to solve a wide variety of problems across the company.
Debasish Behera works as a Data Scientist for a large Japanese corporate bank, where he applies machine learning/AI for solving complex problems. He has worked on multiple use cases involving AML, predictive analytics, customer segmentation, chat bots, and natural language processing. He currently lives in Singapore and holds a Master’s in Business Analytics (MITB) from Singapore Management University.
Pranshu Bhatnagar works as a Data Scientist in the telematics, insurance and mobile software space. He has previously worked as a Quantitative Analyst in the FinTech industry and often writes about algorithms, time series analysis in Python, and similar topics. He graduated with honours from the Chennai Mathematical Institute with a degree in Mathematics and Computer Science and has done certification courses in Machine Learning and Artificial Intelligence from the International Institute of Information Technology, Hyderabad. He is based out of Bangalore, India.
Candas Bilgin is an experienced Data Science Specialist with a demonstrated history of working in the hospital & health care industry. Skilled in Python, R, Machine Learning, Predictive Analytics, and Data Science. Strong engineering professional with a Master of Science (M.Sc.) focused in Electrical, Electronics and Communications Engineering from Yildiz Technical University. He is a Microsoft Certified Data Scientist and also a Certified Tableau Developer.