SlideShare a Scribd company logo
1 of 28
Linear Regression
By: Ms. Sidhidatri Nayak
CDAC NOIDA, India
Objectives
• What is Regression?
• Regression Analysis
• Applications of Regression
• Simple linear regression through Least Squares Method
• Coefficient of Determination
• Using the Estimated Regression Equation for Estimation and
Prediction
• Multiple Linear Regression
• Implementation in Python
Linear Regression
• Linear regression is a supervised machine learning algorithm.
• Statistical process of estimating the relationship among variables.
• There are two types of variables .
i) Dependent variable , whose value is influenced or is to be predicted
ii) Independent Variable, which influences the value and is used for
prediction.
• It shows the relationship between a dependent variable( regressed) and
one or more independent variables(predictors/regressor)
• The predictor is a continuous variable such as sales, salary, age, product
price, etc.
• Linear regression algorithm shows a linear relationship between variables
through a linear equation
Example
• House 1 : x1: 1200sqft y1=200000
• House 2 : x2: 1500sqft y2=300000
• House 3 : x3: 1800sqft y3=400000
• House 4 : x4: 2000sqft y4=500000
• House 5: x5: 2200sqft y5=600000
• Input( x1,x2,x3,x4,x5)
• Output(y1,y2,y3,y4,y5)
• The value of y can be predicted from x, the predictor
variable.
• Y variable is the quantity of interest.
Regression Lines
Applications of Regression
• Predictive Analytics
• Example:
1. Evaluating trend and sales estimate
2. Analyzing the impact of price changes
3. Assessment of risk in financial services and
insurance domain
Regression Analysis
• Regression Analysis is the process of
developing a statistical model , to predict the
value of dependent variable by at least one
independent variable.
The Simple Linear Regression Model
• Simple Linear Regression Model
y = 0 + 1x + 
• Simple Linear Regression Equation
E(y) = 0 + 1x
Example
• ABC café chain located in different cities of India.
It is more popular near the university campus.
The manager believes that the quarterly sales for
the café ( denoted by y) are related to the size of
the student population (denoted by x).
• That is cafes that is near to university campus
with large student population may generate more
sales compared to others.
• Using regression analysis we can develop an
equation showing how the dependent variable y
is related to the independent variable x.
Estimation Process
Scatter plot
The Least Squares Method
• Slope for the Estimated Regression Equation
• Intercept for the Estimated Regression Equation
𝑏0 = 𝑦 − 𝑏1𝑥
where:
xi = value of independent variable for ith
observation
yi = value of dependent variable for ith
observation
x = mean value for independent variable
_
_
𝑏1 =
𝑥𝑖 − 𝑥 𝑦𝑖 − 𝑦
𝑥𝑖 − 𝑥 2
Table 2 calculating the least squares
estimated regression equation for ABC
cafe
Put it in the formula
• b1=2840/568=5
• b0=130-5(14)=60
• Thus the estimated regression equation is
𝑦=60+5x
𝑏0 = 𝑦 − 𝑏1𝑥
Table 3 for SSE
Table for SST
Finding SSR and r2
• SSR=SST-SSE=15730-1530=14200
• Coefficient of Determination
r2 = SSR/SST = 14200/15730 = .9027
Mean Square Error
• An Estimate of s 2
The mean square error (MSE) provides the estimate
of s 2, and the notation s2 is also used.
s2 = MSE = SSE/(n-2)
• MSE=SSE/(n-2)
• MSE=1530/8=191.25
• S=13.829
• The predictive precision of the linear
regression model using evaluation metrics
such as the mean square error.
The Multiple Regression Model
• The Multiple Regression Model
y = 0 + 1x1 + 2x2 + . . . + pxp + 
• The Multiple Regression Equation
E(y) = 0 + 1x1 + 2x2 + . . . + pxp
• The Estimated Multiple Regression
Equation
y = b0 + b1x1 + b2x2 + . . . + bpxp
^
ML_Regression.pptx

More Related Content

Similar to ML_Regression.pptx

Unit 3 – AIML.pptx
Unit 3 – AIML.pptxUnit 3 – AIML.pptx
Unit 3 – AIML.pptxhiblooms
 
Statr session 23 and 24
Statr session 23 and 24Statr session 23 and 24
Statr session 23 and 24Ruru Chowdhury
 
Regression Analysis.pptx
Regression Analysis.pptxRegression Analysis.pptx
Regression Analysis.pptxShivankAggatwal
 
Week 13 Feature Selection Computer Vision Bagian 2
Week 13 Feature Selection Computer Vision Bagian 2Week 13 Feature Selection Computer Vision Bagian 2
Week 13 Feature Selection Computer Vision Bagian 2khairulhuda242
 
Regression analysis
Regression analysisRegression analysis
Regression analysisSrikant001p
 
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...Maninda Edirisooriya
 
Simple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisSimple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisShailendra Tomar
 
Artifical Intelligence And Machine Learning Algorithum.pptx
Artifical Intelligence And Machine Learning Algorithum.pptxArtifical Intelligence And Machine Learning Algorithum.pptx
Artifical Intelligence And Machine Learning Algorithum.pptxAishwarya SenthilNathan
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis pptElkana Rorio
 
REGRESSION METasdfghjklmjhgftrHODS1.pptx
REGRESSION METasdfghjklmjhgftrHODS1.pptxREGRESSION METasdfghjklmjhgftrHODS1.pptx
REGRESSION METasdfghjklmjhgftrHODS1.pptxcajativ595
 
Correlation and regression
Correlation and regressionCorrelation and regression
Correlation and regressionzcreichenbach
 
Application of Machine Learning in Agriculture
Application of Machine  Learning in AgricultureApplication of Machine  Learning in Agriculture
Application of Machine Learning in AgricultureAman Vasisht
 
Data mining 8 estimasi linear regression
Data mining 8   estimasi linear regressionData mining 8   estimasi linear regression
Data mining 8 estimasi linear regressionIrwansyahSaputra1
 

Similar to ML_Regression.pptx (20)

Unit 3 – AIML.pptx
Unit 3 – AIML.pptxUnit 3 – AIML.pptx
Unit 3 – AIML.pptx
 
Statr session 23 and 24
Statr session 23 and 24Statr session 23 and 24
Statr session 23 and 24
 
Regression Analysis.pptx
Regression Analysis.pptxRegression Analysis.pptx
Regression Analysis.pptx
 
Machine learning meetup
Machine learning meetupMachine learning meetup
Machine learning meetup
 
Week 13 Feature Selection Computer Vision Bagian 2
Week 13 Feature Selection Computer Vision Bagian 2Week 13 Feature Selection Computer Vision Bagian 2
Week 13 Feature Selection Computer Vision Bagian 2
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
Lecture 4 - Linear Regression, a lecture in subject module Statistical & Mach...
 
BRM-lecture-11.ppt
BRM-lecture-11.pptBRM-lecture-11.ppt
BRM-lecture-11.ppt
 
Simple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisSimple & Multiple Regression Analysis
Simple & Multiple Regression Analysis
 
Artifical Intelligence And Machine Learning Algorithum.pptx
Artifical Intelligence And Machine Learning Algorithum.pptxArtifical Intelligence And Machine Learning Algorithum.pptx
Artifical Intelligence And Machine Learning Algorithum.pptx
 
Linear Regression
Linear RegressionLinear Regression
Linear Regression
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis ppt
 
linear regression .pptx
linear regression .pptxlinear regression .pptx
linear regression .pptx
 
Central tendency
Central tendencyCentral tendency
Central tendency
 
REGRESSION METasdfghjklmjhgftrHODS1.pptx
REGRESSION METasdfghjklmjhgftrHODS1.pptxREGRESSION METasdfghjklmjhgftrHODS1.pptx
REGRESSION METasdfghjklmjhgftrHODS1.pptx
 
Correlation and regression
Correlation and regressionCorrelation and regression
Correlation and regression
 
Application of Machine Learning in Agriculture
Application of Machine  Learning in AgricultureApplication of Machine  Learning in Agriculture
Application of Machine Learning in Agriculture
 
Data mining 8 estimasi linear regression
Data mining 8   estimasi linear regressionData mining 8   estimasi linear regression
Data mining 8 estimasi linear regression
 
Simple Linear Regression.pptx
Simple Linear Regression.pptxSimple Linear Regression.pptx
Simple Linear Regression.pptx
 
Simple egression.pptx
Simple egression.pptxSimple egression.pptx
Simple egression.pptx
 

Recently uploaded

Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 

Recently uploaded (20)

Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 

ML_Regression.pptx

  • 1. Linear Regression By: Ms. Sidhidatri Nayak CDAC NOIDA, India
  • 2. Objectives • What is Regression? • Regression Analysis • Applications of Regression • Simple linear regression through Least Squares Method • Coefficient of Determination • Using the Estimated Regression Equation for Estimation and Prediction • Multiple Linear Regression • Implementation in Python
  • 3. Linear Regression • Linear regression is a supervised machine learning algorithm. • Statistical process of estimating the relationship among variables. • There are two types of variables . i) Dependent variable , whose value is influenced or is to be predicted ii) Independent Variable, which influences the value and is used for prediction. • It shows the relationship between a dependent variable( regressed) and one or more independent variables(predictors/regressor) • The predictor is a continuous variable such as sales, salary, age, product price, etc. • Linear regression algorithm shows a linear relationship between variables through a linear equation
  • 4. Example • House 1 : x1: 1200sqft y1=200000 • House 2 : x2: 1500sqft y2=300000 • House 3 : x3: 1800sqft y3=400000 • House 4 : x4: 2000sqft y4=500000 • House 5: x5: 2200sqft y5=600000 • Input( x1,x2,x3,x4,x5) • Output(y1,y2,y3,y4,y5) • The value of y can be predicted from x, the predictor variable. • Y variable is the quantity of interest.
  • 5.
  • 6.
  • 8. Applications of Regression • Predictive Analytics • Example: 1. Evaluating trend and sales estimate 2. Analyzing the impact of price changes 3. Assessment of risk in financial services and insurance domain
  • 9. Regression Analysis • Regression Analysis is the process of developing a statistical model , to predict the value of dependent variable by at least one independent variable.
  • 10. The Simple Linear Regression Model • Simple Linear Regression Model y = 0 + 1x +  • Simple Linear Regression Equation E(y) = 0 + 1x
  • 11. Example • ABC café chain located in different cities of India. It is more popular near the university campus. The manager believes that the quarterly sales for the café ( denoted by y) are related to the size of the student population (denoted by x). • That is cafes that is near to university campus with large student population may generate more sales compared to others. • Using regression analysis we can develop an equation showing how the dependent variable y is related to the independent variable x.
  • 14. The Least Squares Method • Slope for the Estimated Regression Equation • Intercept for the Estimated Regression Equation 𝑏0 = 𝑦 − 𝑏1𝑥 where: xi = value of independent variable for ith observation yi = value of dependent variable for ith observation x = mean value for independent variable _ _ 𝑏1 = 𝑥𝑖 − 𝑥 𝑦𝑖 − 𝑦 𝑥𝑖 − 𝑥 2
  • 15. Table 2 calculating the least squares estimated regression equation for ABC cafe
  • 16. Put it in the formula • b1=2840/568=5 • b0=130-5(14)=60 • Thus the estimated regression equation is 𝑦=60+5x 𝑏0 = 𝑦 − 𝑏1𝑥
  • 17.
  • 18. Table 3 for SSE
  • 20.
  • 21. Finding SSR and r2 • SSR=SST-SSE=15730-1530=14200 • Coefficient of Determination r2 = SSR/SST = 14200/15730 = .9027
  • 22.
  • 23.
  • 24. Mean Square Error • An Estimate of s 2 The mean square error (MSE) provides the estimate of s 2, and the notation s2 is also used. s2 = MSE = SSE/(n-2)
  • 25.
  • 26. • MSE=SSE/(n-2) • MSE=1530/8=191.25 • S=13.829 • The predictive precision of the linear regression model using evaluation metrics such as the mean square error.
  • 27. The Multiple Regression Model • The Multiple Regression Model y = 0 + 1x1 + 2x2 + . . . + pxp +  • The Multiple Regression Equation E(y) = 0 + 1x1 + 2x2 + . . . + pxp • The Estimated Multiple Regression Equation y = b0 + b1x1 + b2x2 + . . . + bpxp ^