0% found this document useful (0 votes)
24 views20 pages

Understanding Predictive Analytics

Data Science analytics

Uploaded by

pbajet493
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views20 pages

Understanding Predictive Analytics

Data Science analytics

Uploaded by

pbajet493
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Predictive Analytics

Overview
• Predictive analytics is the process of using data to forecast future outcomes. The process uses data
analysis, machine learning, artificial intelligence, and statistical models to find patterns that might
predict future behavior.
• Organizations can use historic and current data to forecast trends and behaviors seconds, days, or
years into the future with a great deal of precision.
Applications
Fraud detection
Predictive analytics examines all actions on a company’s network in real time to pinpoint abnormalities
that indicate fraud and other vulnerabilities.
Conversion and purchase prediction
Companies can take actions, like retargeting online ads to visitors, with data that predicts a greater
likelihood of conversion and purchase intent.
Risk reduction
Credit scores, insurance claims, and debt collections all use predictive analytics to assess and determine
the likelihood of future defaults.
Operational improvement
Companies use predictive analytics models to forecast inventory, manage resources, and operate more
efficiently.
Customer segmentation
By dividing a customer base into specific groups, marketers can use predictive analytics to make forward-
looking decisions to tailor content to unique audiences.
Maintenance forecasting
Organizations use data to predict when routine equipment maintenance will be required and can then
schedule it before a problem or malfunction arises.
Types of Predictive Model
Classification is a predictive modeling task where the output variable (target) is a discrete label or
category. The goal is to assign each input instance to one of a predefined set of classes.

Example

For instance, if a retailer has a lot of data on different types of customers, they may try to predict what
types of customers will be receptive to market emails.

Regression is a predictive modeling task where the output variable (target) is continuous. The goal is to
predict a numeric value based on input features.

Example

Regression models try to predict continuous data, such as how much revenue that customer will generate
during their relationship with the company.
Techniques in Predictive Analytics
Decision trees are classification models that place data into different categories based on distinct
variables. The method is best used when trying to understand an individual's decisions. The model looks
like a tree, with each branch representing a potential choice, with the leaf of the branch representing the
result of the decision.

Examples
1.
"Is it sunny outside?"
Decision 1: If yes, you might decide to go for a picnic.
Decision 2: If no, you might move to the next question.

2.
"Is it raining?"

Decision 1 :If yes, you might decide to stay indoors.


Decision 2 If no, you might decide to go shopping.
Techniques in Predictive Analytics
Neural networks are machine learning methods that are useful in predictive analytics when modeling
very complex relationships. Essentially, they are powerhouse pattern recognition engines. Neural
networks are best used to determine nonlinear relationships in datasets, especially when no known
mathematical formula exists to analyze the data. Neural networks can be used to validate the results of
decision trees and regression models.

Example
One example of this is the use of neural networks to
diagnose Alzheimer’s disease. Neural networks can
be used to identify changes in brain activity that
occur before the onset of symptoms.
Techniques in Predictive Analytics
Regression is a statistical analysis technique that estimates relationships between variables. Regression is
useful to determine patterns in large datasets to determine the correlation between inputs. It is best
employed on continuous data that follows a known distribution. Regression is often used to determine
how one or more independent variables affects another, such as how a price increase will affect the sale
of a product.

Examples

[Link] a car's price based on its age, mileage, and brand.


2. Predicting a person's weight based on their height and age.
Linear Regression
Linear regression analysis is used to predict the value of a variable based on the value of another
variable.

Dependent variable (aka criterion variable) is the main factor you are trying to understand and predict.

Independent variables (aka explanatory variables, or predictors) are the factors that might influence the
dependent variable.

Simple linear regression models the relationship between a dependent variable and one independent
variables using a linear function. If you use two or more explanatory variables to predict the dependent
variable, you deal with multiple linear regression.

y = mx + b
Formulas in Linear Regression

Linear regression: 𝑦 = 𝑚𝑥 + 𝑏 𝑌𝑖 = dependent variable


𝑋𝑖 = independent variable
𝑋 = mean of x variable
σ(𝑋𝑖 −𝑋)(𝑌𝑖 −𝑌)
Slope : 𝑚= σ(𝑋𝑖 −𝑋)2
𝑌 = mean of y variable
𝑚 = slope
𝑏 = intercept

Intercept : 𝑏 = 𝑌ത − 𝑚𝑋ത
Examples
Problem: Predict the exam score based on the number of study hours.

Study Hours (X) Exam Score (Y)


1 50
2 55
3 60
4 65
5 70
Examples
Step 1: Calculate the Means

First, calculate the mean (average) of both the study hours (X) and the exam scores (Y).

σ 𝑋𝑖 1+2+3+4+5 15
𝑋ത = = = =3
𝑁 5 5
σ 𝑌𝑖 50 + 55 + 60 + 65 + 70 300

𝑌= = = = 60
𝑁 5 5
Examples
Step 2: Calculate the Slope (m)
The slope of the line is given by the formula:

σ(𝑋𝑖 − 𝑋)(𝑌𝑖 − 𝑌)
𝑚=
σ(𝑋𝑖 − 𝑋)2
Step 2.1: Compute the products (𝑋𝑖 − 𝑋)(𝑌𝑖 − 𝑌) and squares (𝑋𝑖 − 𝑋)2 .

X Y 𝑋𝑖 − 𝑋 𝑌𝑖 − 𝑌 (𝑋𝑖 − 𝑋)(𝑌𝑖 − 𝑌) (𝑋𝑖 − 𝑋)2


1 50 -2 -10 20 4
2 55 -1 -5 5 1
3 60 0 0 0 0
4 65 1 5 5 1
5 70 2 10 20 4
Examples
Step 2.2: Calculate the sums

෍ 𝑋𝑖 − 𝑋 𝑌𝑖 − 𝑌 = 20 + 5 + 0 + 5 + 20 = 50

෍(𝑋𝑖 − 𝑋)2 = 4 + 1 + 0 + 1 + 4 = 10

Step 2.3: Calculate the slope


50
𝑚= =𝟓
10
Examples
Step 3: Calculate the Intercept (b)
The intercept is given by the formula:

𝑏 = 𝑌ത − 𝑚𝑋ത
𝑏 = 60 − 5 ∗ 3 = 60 − 15 = 𝟒𝟓
Step 4: Construct the Equation of the Line
Now that we have the slope (m=5) and intercept (b=45), the equation of the regression line is:

𝑦 = 5𝑥 + 45
Step 5: Make Predictions
Now, you can predict the exam score (Y) for any given study hour (X) using the regression equation.
For example, if a student studies for 6 hours:

𝑦 = 5 6 + 45 = 30 + 45 = 𝟕𝟓
So, the predicted exam score for 6 hours of study is 75.
Examples
Problem: Predicting sales based on advertising budget.

Advertising Budget (X) Sales (Y)


1 2
2 4
3 5
4 4
5 5
Examples
Step 1: Calculate the Means

First, calculate the mean (average) of both the study hours (X) and the exam scores (Y).

σ 𝑋𝑖 1+2+3+4+5 15
𝑋ത = = = =3
𝑁 5 5
σ 𝑌𝑖 2+4+5+4+5 20

𝑌= = = =4
𝑁 5 5
Examples
Step 2: Calculate the Slope (m)
The slope of the line is given by the formula:

σ(𝑋𝑖 − 𝑋)(𝑌𝑖 − 𝑌)
𝑚=
σ(𝑋𝑖 − 𝑋)2
Step 2.1: Compute the products (𝑋𝑖 − 𝑋)(𝑌𝑖 − 𝑌) and squares (𝑋𝑖 − 𝑋)2 .

X Y 𝑋𝑖 − 𝑋 𝑌𝑖 − 𝑌 (𝑋𝑖 − 𝑋)(𝑌𝑖 − 𝑌) (𝑋𝑖 − 𝑋)2


1 2 -2 -2 4 4
2 4 -1 0 0 1
3 5 0 1 0 0
4 4 1 0 0 1
5 5 2 1 2 4
Examples
Step 2.2: Calculate the sums

෍ 𝑋𝑖 − 𝑋 𝑌𝑖 − 𝑌 = 4 + 0 + 0 + 0 + 2 = 𝟔

෍(𝑋𝑖 − 𝑋)2 = 4 + 1 + 0 + 1 + 4 = 10

Step 2.3: Calculate the slope


6
𝑚= = 𝟎. 𝟔
10
Examples
Step 3: Calculate the Intercept (b)
The intercept is given by the formula:

𝑏 = 𝑌ത − 𝑚𝑋ത
𝑏 = 4 − 0.6 ∗ 3 = 4 − 1.8 = 𝟐. 𝟐
Step 4: Construct the Equation of the Line
Now that we have the slope (m=0.6) and intercept (b=2.2), the equation of the regression line is:

𝑦 = 0.6𝑥 + 2.2
Step 5: Make Predictions
Now, you can predict the sales (Y) based on a given advertising budget (X) using the regression equation.
For example, if the advertising budget is 6:

𝑦 = 0.6 6 + 2.2 = 3.6 + 2.2 = 𝟓. 𝟖


So, the predicted sales for an advertising budget of 6 is 5.8.

You might also like