SlideShare a Scribd company logo
1 of 54
Profit Estimation of a Company
Which companies
shall we invest?
Venture Capital firm
A Venture Capital firm is trying to understand which companies should they invest
Profit Estimation of a Company
Idea
Based on companies expenses
Predict the profit companies make
Decide companies to invest
Profit Estimation of a Company
Administration
Marketing
State
R&D
Based on
Expenditure and
Location
Company Calculate profit
Profit Estimation of a Company
For simplicity, lets consider a single variable (R&D) and find out which companies to invest in
R&D
Profit
R&D
Profit
Companies spending
more on R&D make
good profit, let’s
invest in them
Plotting profit based on R&D
expenditure
Prediction line to estimate profit
What’s in it for you?
Machine Learning Algorithms
Understanding Linear Regression
Introduction to Machine Learning
Applications of Linear Regression
Multiple Linear Regression
Use Case – Profit Estimation of Companies
Introduction to Machine Learning
Introduction to Machine Learning
Based on the amount of rainfall, how much would be the crop yield?
Crop Field Predict crop yieldBased on Rainfall
Independent and Dependent Variables
Independent variable Dependent variable
A variable whose value does not change
by the effect of other variables and is
used to manipulate the dependent
variable. It is often denoted as X.
A variable whose value change when
there is any manipulation in the values of
independent variables. It is often denoted
as Y.
Crop yield depends on the amount of
rainfall received
Rainfall – Independent variable Crop yield – Dependent variable
In our example:
Numerical and Categorical Values
Data
SalaryAge Height Gender
Dog’s
BreedColor
12345
167891
46920
12345
90984
Numerical Categorical
A
C
D
E
B
Machine Learning Algorithms
Machine Learning
Algorithms
Supervised
Unsupervised
Reinforcement
Machine Learning Algorithms
Machine Learning
Algorithms
Supervised
ClassificationRegression
Machine Learning Algorithms
Machine Learning
Algorithms
Supervised
Regression
Simple Linear
Regression
Polynomial Linear
Regression
Multiple Linear
Regression
Applications of Linear Regression
Applications of Linear Regression
Economic Growth
Used to determine the Economic Growth of a country or a state in the coming
quarter, can also be used to predict the GDP of a country
Applications of Linear Regression
Product price
Can be used to predict what would be the price of a product in the future
Applications of Linear Regression
Housing sales
To estimate the number of houses a builder would sell and at what price in the
coming months
Applications of Linear Regression
Score Prediction
To predict the number of runs a player would score in the coming matches based
on previous performance
Understanding Linear Regression
Understanding Linear Regression
Linear Regression is a statistical model used to predict the relationship between
independent and dependent variables.
Examine 2 factors
Which variables in
particular are
significant predictors
of the outcome
variables?
1
How significant is
the Regression line
to make predictions
with highest
possible accuracy
2
Regression Equation
The simplest form of a simple linear regression equation with one dependent and one independent variable is represented by:
y = m x + c*
y ---> Dependent Variable
x ---> Independent Variable
c ---> Coefficient of the line
y2 - y1
x2 – x1
m =m ---> Slope of the line
Y
X
c
m
y2
y1
x2x1
Prediction using the Regression line
Rainfall (X)
CropYield(Y)
Plotting the amount of Crop Yield based on
the amount of Rainfall
Prediction using the Regression line
Rainfall (X)
CropYield(Y)
Plotting the amount of Crop Yield based on
the amount of Rainfall
Rainfall (X)
CropYield(Y)
Prediction using the Regression line
The Red point on the Y axis is the amount of Crop
Yield you can expect for some amount of Rainfall
(X) represented by Green dot
Rainfall (X)
CropYield(Y)
Plotting the amount of Crop Yield based on
the amount of Rainfall
Rainfall (X)
CropYield(Y)
Regression Line
Intuition behind the Regression line
Lets consider a sample dataset with 5 rows and find out how to draw the regression
line
X Y
1 2
2 4
3 5
4 4
5 5
Independent
variable
Dependent variable
Plotting the data points
Intuition behind the Regression line
Calculate the mean of X and Y and plot the values
X Y
1 2
2 4
3 5
4 4
5 5
Independent
variable
Dependent variable
Plotting the mean of X and Y
Mean 3 4
Intuition behind the Regression line
Regression line should ideally pass through the mean of X and Y
X Y
1 2
2 4
3 5
4 4
5 5
Independent
variable
Dependent variable
Regression line
Mean 3 4
(3,4)
Intuition behind the Regression line
Drawing the equation of the Regression line
_
_ _
X Y (X ) (Y ) (X Y)
1 2 1 4 2
2 4 4 16 8
3 5 9 25 15
4 4 16 16 16
5 5 25 25 25
= 66
Linear equation is represented as Y = m X + c
=m =
*
Y = m X + c
= 0.6 3 + 2.2
= 4
*
2 2
= 55 = 86
*
= 15 = 20
c=
*
((n (X Y))-( (X) (Y))***
((n (X ))-( (X) )*
2 2
((5 66)-(15 20))* *
((5 55))-(225)*
=0.6
(( (Y) (X ))-( (X) (X Y)*
2
* *
((n (X ))-( (X) )*
2 2 = 2.2
Intuition behind the Regression line
Lets find out the predicted values of Y for corresponding values of X using the linear
equation where m=0.6 and c=2.2
Here the blue points represent the actual Y
values and the brown points represent the
predicted Y values. The distance between the
actual and predicted values are known as
residuals or errors. The best fit line should
have the least sum of squares of these errors
also known as
e square.
(3,4)
Y
Y=0.6 1+2.2=2.8
Y=0.6 2+2.2=3.4
Y=0.6 3+2.2=4
Y=0.6 4+2.2=4.6
Y=0.6 5+2.2=5.2
pred
*
*
*
*
*
Intuition behind the Regression line
Lets find out the predicted values of Y for corresponding values of X using the linear
equation where m=0.6 and c=2.2
(3,4)
_ _
X Y Y (Y-Y ) (Y-Y )
1 2 2.8 -0.8 0.64
2 4 3.4 0.6 0.36
3 5 4 1 1
4 4 4.6 -0.6 0.36
5 5 5.2 -0.2 0.04
= 2.4
pred pred pred
2
The sum of squared errors for this regression line is 2.4. We check this
error for each line and conclude the best fit line having the least e square
value.
Finding the Best fit line
Minimizing the Distance: There are lots of ways to minimize the distance between the line and the data points like Sum of
Squared errors, Sum of Absolute errors, Root Mean Square error etc.
We keep moving this line through the
data points to make sure the Best fit
line has the least square distance
between the data points and the
regression line
Multiple Linear Regression
Multiple Linear Regression
Simple Linear
Regression
Multiple Linear
Regression
Y = m x + c*
2 *
Y = m x + m x + m x + ………. + m x + c*1 1 * 2 3 3*2 n n*
Independent variables (IDV’s)
Dependent variable (DV) Coefficient
nm1, m2, m3…..m
Slopes
Implementation of Linear Regression
Use case implementation of Linear Regression
Let’s understand how
Multiple Linear
Regression works by
implementing it in Python
Use case implementation of Linear Regression
1000 Companies
Profit
Expenditure
Based on
Predict
Use case implementation of Linear Regression
Predicting Profit of 1000 companies based on the attributes mentioned in the figure:
Profit
Estimation
Use case implementation of Linear Regression
Predicting Profit of 1000 companies based on the attributes mentioned in the figure:
R&D Spend
1
Profit
Estimation
Use case implementation of Linear Regression
Predicting Profit of 1000 companies based on the attributes mentioned in the figure:
R&D Spend
1
Administration
2
Profit
Estimation
Use case implementation of Linear Regression
Predicting Profit of 1000 companies based on the attributes mentioned in the figure:
R&D Spend
1
Marketing Spend
3
Administration
2
Profit
Estimation
Use case implementation of Linear Regression
Predicting Profit of 1000 companies based on the attributes mentioned in the figure:
R&D Spend
1
State
4
Marketing Spend
3
Administration
2
Profit
Estimation
Use case implementation of Linear Regression
Predicting Profit of 1000 companies based on the attributes mentioned in the figure:
R&D Spend
1
State
4
Marketing Spend
3
Administration
2
ProfitProfit
Profit
Estimation
Use case implementation of Linear Regression
Predicting Profit of 1000 companies based on the attributes mentioned in the figure:
R&D Spend
1
State
4
Marketing Spend
3
Administration
2
ProfitProfit
Profit
Estimation
Predict Profit
Use case implementation of Linear Regression
1. Import the libraries:
Use case implementation of Linear Regression
2. Load the Dataset and extract independent and dependent variables:
Use case implementation of Linear Regression
3. Data Visualization:
Use case implementation of Linear Regression
4. Encoding Categorical Data:
5. Avoiding Dummy Variable Trap:
Use case implementation of Linear Regression
6. Splitting the data into Train and Test set:
7. Fitting Multiple Linear Regression Model to Training set:
Use case implementation of Linear Regression
8. Predicting the Test set results:
Use case implementation of Linear Regression
9. Calculating the Coefficients and Intercepts:
Use case implementation of Linear Regression
10. Evaluating the model:
R squared value of 0.91 proves the model is a good model
Use case summary
We successfully trained our model with
certain predictors and estimated the
profit of companies using linear
regression
Key Takeaways
Linear Regression Analysis | Linear Regression in Python | Machine Learning Algorithms | Simplilearn

More Related Content

What's hot

Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision treesKnoldus Inc.
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Simplilearn
 
Classification in data mining
Classification in data mining Classification in data mining
Classification in data mining Sulman Ahmed
 
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Edureka!
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regressionkishanthkumaar
 
Machine Learning Course | Edureka
Machine Learning Course | EdurekaMachine Learning Course | Edureka
Machine Learning Course | EdurekaEdureka!
 
Dimensionality Reduction
Dimensionality ReductionDimensionality Reduction
Dimensionality Reductionmrizwan969
 
Types of Machine Learning
Types of Machine LearningTypes of Machine Learning
Types of Machine LearningSamra Shahzadi
 
Classification and Regression
Classification and RegressionClassification and Regression
Classification and RegressionMegha Sharma
 
ML - Multiple Linear Regression
ML - Multiple Linear RegressionML - Multiple Linear Regression
ML - Multiple Linear RegressionAndrew Ferlitsch
 
NAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIERNAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIERKnoldus Inc.
 
Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning Usama Fayyaz
 
Linear Regression vs Logistic Regression | Edureka
Linear Regression vs Logistic Regression | EdurekaLinear Regression vs Logistic Regression | Edureka
Linear Regression vs Logistic Regression | EdurekaEdureka!
 
Decision trees for machine learning
Decision trees for machine learningDecision trees for machine learning
Decision trees for machine learningAmr BARAKAT
 
Ensemble methods in machine learning
Ensemble methods in machine learningEnsemble methods in machine learning
Ensemble methods in machine learningSANTHOSH RAJA M G
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)Abhimanyu Dwivedi
 
Supervised and Unsupervised Machine Learning
Supervised and Unsupervised Machine LearningSupervised and Unsupervised Machine Learning
Supervised and Unsupervised Machine LearningSpotle.ai
 
Decision Trees
Decision TreesDecision Trees
Decision TreesStudent
 
Ensemble learning
Ensemble learningEnsemble learning
Ensemble learningHaris Jamil
 

What's hot (20)

Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
 
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
 
Classification in data mining
Classification in data mining Classification in data mining
Classification in data mining
 
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
 
Machine Learning Course | Edureka
Machine Learning Course | EdurekaMachine Learning Course | Edureka
Machine Learning Course | Edureka
 
Dimensionality Reduction
Dimensionality ReductionDimensionality Reduction
Dimensionality Reduction
 
Types of Machine Learning
Types of Machine LearningTypes of Machine Learning
Types of Machine Learning
 
Classification and Regression
Classification and RegressionClassification and Regression
Classification and Regression
 
ML - Multiple Linear Regression
ML - Multiple Linear RegressionML - Multiple Linear Regression
ML - Multiple Linear Regression
 
NAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIERNAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIER
 
Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning
 
Linear Regression vs Logistic Regression | Edureka
Linear Regression vs Logistic Regression | EdurekaLinear Regression vs Logistic Regression | Edureka
Linear Regression vs Logistic Regression | Edureka
 
K - Nearest neighbor ( KNN )
K - Nearest neighbor  ( KNN )K - Nearest neighbor  ( KNN )
K - Nearest neighbor ( KNN )
 
Decision trees for machine learning
Decision trees for machine learningDecision trees for machine learning
Decision trees for machine learning
 
Ensemble methods in machine learning
Ensemble methods in machine learningEnsemble methods in machine learning
Ensemble methods in machine learning
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)
 
Supervised and Unsupervised Machine Learning
Supervised and Unsupervised Machine LearningSupervised and Unsupervised Machine Learning
Supervised and Unsupervised Machine Learning
 
Decision Trees
Decision TreesDecision Trees
Decision Trees
 
Ensemble learning
Ensemble learningEnsemble learning
Ensemble learning
 

Similar to Linear Regression Analysis | Linear Regression in Python | Machine Learning Algorithms | Simplilearn

Intro to econometrics
Intro to econometricsIntro to econometrics
Intro to econometricsGaetan Lion
 
Tbs910 regression models
Tbs910 regression modelsTbs910 regression models
Tbs910 regression modelsStephen Ong
 
Demand forecasting methods 1 gp
Demand forecasting methods 1 gpDemand forecasting methods 1 gp
Demand forecasting methods 1 gpPUTTU GURU PRASAD
 
Statistics project2
Statistics project2Statistics project2
Statistics project2shri1984
 
Bba 3274 qm week 6 part 1 regression models
Bba 3274 qm week 6 part 1 regression modelsBba 3274 qm week 6 part 1 regression models
Bba 3274 qm week 6 part 1 regression modelsStephen Ong
 
Course Title: Introduction to Machine Learning, Chapter 2- Supervised Learning
Course Title: Introduction to Machine Learning,  Chapter 2- Supervised LearningCourse Title: Introduction to Machine Learning,  Chapter 2- Supervised Learning
Course Title: Introduction to Machine Learning, Chapter 2- Supervised LearningShumet Tadesse
 
Demand Estimation AND FORECASTING
Demand Estimation AND FORECASTINGDemand Estimation AND FORECASTING
Demand Estimation AND FORECASTINGRebekahSamuel2
 
Data Analysison Regression
Data Analysison RegressionData Analysison Regression
Data Analysison Regressionjamuga gitulho
 
Multiple Regression.ppt
Multiple Regression.pptMultiple Regression.ppt
Multiple Regression.pptTanyaWadhwani4
 
Simple lin regress_inference
Simple lin regress_inferenceSimple lin regress_inference
Simple lin regress_inferenceKemal İnciroğlu
 
Curve_Fitting.pdf
Curve_Fitting.pdfCurve_Fitting.pdf
Curve_Fitting.pdfIrfan Khan
 
Statr session14, Jan 11
Statr session14, Jan 11Statr session14, Jan 11
Statr session14, Jan 11Ruru Chowdhury
 
Simple Regression Years with Midwest and Shelf Space Winter .docx
Simple Regression Years with Midwest and Shelf Space Winter .docxSimple Regression Years with Midwest and Shelf Space Winter .docx
Simple Regression Years with Midwest and Shelf Space Winter .docxbudabrooks46239
 
4. regression analysis1
4. regression analysis14. regression analysis1
4. regression analysis1Karan Kukreja
 

Similar to Linear Regression Analysis | Linear Regression in Python | Machine Learning Algorithms | Simplilearn (20)

The Suitcase Case
The Suitcase CaseThe Suitcase Case
The Suitcase Case
 
Rsh qam11 ch04 ge
Rsh qam11 ch04 geRsh qam11 ch04 ge
Rsh qam11 ch04 ge
 
Regression
RegressionRegression
Regression
 
Intro to econometrics
Intro to econometricsIntro to econometrics
Intro to econometrics
 
Tbs910 regression models
Tbs910 regression modelsTbs910 regression models
Tbs910 regression models
 
Demand forecasting methods 1 gp
Demand forecasting methods 1 gpDemand forecasting methods 1 gp
Demand forecasting methods 1 gp
 
Statistics project2
Statistics project2Statistics project2
Statistics project2
 
Bba 3274 qm week 6 part 1 regression models
Bba 3274 qm week 6 part 1 regression modelsBba 3274 qm week 6 part 1 regression models
Bba 3274 qm week 6 part 1 regression models
 
Demand Forcasting
Demand ForcastingDemand Forcasting
Demand Forcasting
 
Course Title: Introduction to Machine Learning, Chapter 2- Supervised Learning
Course Title: Introduction to Machine Learning,  Chapter 2- Supervised LearningCourse Title: Introduction to Machine Learning,  Chapter 2- Supervised Learning
Course Title: Introduction to Machine Learning, Chapter 2- Supervised Learning
 
Demand Estimation AND FORECASTING
Demand Estimation AND FORECASTINGDemand Estimation AND FORECASTING
Demand Estimation AND FORECASTING
 
Data Analysison Regression
Data Analysison RegressionData Analysison Regression
Data Analysison Regression
 
Regression
Regression  Regression
Regression
 
Multiple Regression.ppt
Multiple Regression.pptMultiple Regression.ppt
Multiple Regression.ppt
 
Simple lin regress_inference
Simple lin regress_inferenceSimple lin regress_inference
Simple lin regress_inference
 
Curve_Fitting.pdf
Curve_Fitting.pdfCurve_Fitting.pdf
Curve_Fitting.pdf
 
Statr session14, Jan 11
Statr session14, Jan 11Statr session14, Jan 11
Statr session14, Jan 11
 
Regression
RegressionRegression
Regression
 
Simple Regression Years with Midwest and Shelf Space Winter .docx
Simple Regression Years with Midwest and Shelf Space Winter .docxSimple Regression Years with Midwest and Shelf Space Winter .docx
Simple Regression Years with Midwest and Shelf Space Winter .docx
 
4. regression analysis1
4. regression analysis14. regression analysis1
4. regression analysis1
 

More from Simplilearn

ChatGPT in Cybersecurity
ChatGPT in CybersecurityChatGPT in Cybersecurity
ChatGPT in CybersecuritySimplilearn
 
Whatis SQL Injection.pptx
Whatis SQL Injection.pptxWhatis SQL Injection.pptx
Whatis SQL Injection.pptxSimplilearn
 
Top 5 High Paying Cloud Computing Jobs in 2023
 Top 5 High Paying Cloud Computing Jobs in 2023  Top 5 High Paying Cloud Computing Jobs in 2023
Top 5 High Paying Cloud Computing Jobs in 2023 Simplilearn
 
Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Simplilearn
 
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Simplilearn
 
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...Simplilearn
 
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Simplilearn
 
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...Simplilearn
 
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Simplilearn
 
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...Simplilearn
 
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Simplilearn
 
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Simplilearn
 
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Simplilearn
 
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...Simplilearn
 
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...Simplilearn
 
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...Simplilearn
 
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...Simplilearn
 
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Simplilearn
 
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...Simplilearn
 
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...Simplilearn
 

More from Simplilearn (20)

ChatGPT in Cybersecurity
ChatGPT in CybersecurityChatGPT in Cybersecurity
ChatGPT in Cybersecurity
 
Whatis SQL Injection.pptx
Whatis SQL Injection.pptxWhatis SQL Injection.pptx
Whatis SQL Injection.pptx
 
Top 5 High Paying Cloud Computing Jobs in 2023
 Top 5 High Paying Cloud Computing Jobs in 2023  Top 5 High Paying Cloud Computing Jobs in 2023
Top 5 High Paying Cloud Computing Jobs in 2023
 
Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024
 
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
 
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
 
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
 
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
 
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
 
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
 
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
 
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
 
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
 
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
 
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
 
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
 
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
 
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
 
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
 
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
 

Recently uploaded

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Linear Regression Analysis | Linear Regression in Python | Machine Learning Algorithms | Simplilearn

  • 1.
  • 2. Profit Estimation of a Company Which companies shall we invest? Venture Capital firm A Venture Capital firm is trying to understand which companies should they invest
  • 3. Profit Estimation of a Company Idea Based on companies expenses Predict the profit companies make Decide companies to invest
  • 4. Profit Estimation of a Company Administration Marketing State R&D Based on Expenditure and Location Company Calculate profit
  • 5. Profit Estimation of a Company For simplicity, lets consider a single variable (R&D) and find out which companies to invest in R&D Profit R&D Profit Companies spending more on R&D make good profit, let’s invest in them Plotting profit based on R&D expenditure Prediction line to estimate profit
  • 6. What’s in it for you? Machine Learning Algorithms Understanding Linear Regression Introduction to Machine Learning Applications of Linear Regression Multiple Linear Regression Use Case – Profit Estimation of Companies
  • 8. Introduction to Machine Learning Based on the amount of rainfall, how much would be the crop yield? Crop Field Predict crop yieldBased on Rainfall
  • 9. Independent and Dependent Variables Independent variable Dependent variable A variable whose value does not change by the effect of other variables and is used to manipulate the dependent variable. It is often denoted as X. A variable whose value change when there is any manipulation in the values of independent variables. It is often denoted as Y. Crop yield depends on the amount of rainfall received Rainfall – Independent variable Crop yield – Dependent variable In our example:
  • 10. Numerical and Categorical Values Data SalaryAge Height Gender Dog’s BreedColor 12345 167891 46920 12345 90984 Numerical Categorical A C D E B
  • 11. Machine Learning Algorithms Machine Learning Algorithms Supervised Unsupervised Reinforcement
  • 12. Machine Learning Algorithms Machine Learning Algorithms Supervised ClassificationRegression
  • 13. Machine Learning Algorithms Machine Learning Algorithms Supervised Regression Simple Linear Regression Polynomial Linear Regression Multiple Linear Regression
  • 15. Applications of Linear Regression Economic Growth Used to determine the Economic Growth of a country or a state in the coming quarter, can also be used to predict the GDP of a country
  • 16. Applications of Linear Regression Product price Can be used to predict what would be the price of a product in the future
  • 17. Applications of Linear Regression Housing sales To estimate the number of houses a builder would sell and at what price in the coming months
  • 18. Applications of Linear Regression Score Prediction To predict the number of runs a player would score in the coming matches based on previous performance
  • 20. Understanding Linear Regression Linear Regression is a statistical model used to predict the relationship between independent and dependent variables. Examine 2 factors Which variables in particular are significant predictors of the outcome variables? 1 How significant is the Regression line to make predictions with highest possible accuracy 2
  • 21. Regression Equation The simplest form of a simple linear regression equation with one dependent and one independent variable is represented by: y = m x + c* y ---> Dependent Variable x ---> Independent Variable c ---> Coefficient of the line y2 - y1 x2 – x1 m =m ---> Slope of the line Y X c m y2 y1 x2x1
  • 22. Prediction using the Regression line Rainfall (X) CropYield(Y) Plotting the amount of Crop Yield based on the amount of Rainfall
  • 23. Prediction using the Regression line Rainfall (X) CropYield(Y) Plotting the amount of Crop Yield based on the amount of Rainfall Rainfall (X) CropYield(Y)
  • 24. Prediction using the Regression line The Red point on the Y axis is the amount of Crop Yield you can expect for some amount of Rainfall (X) represented by Green dot Rainfall (X) CropYield(Y) Plotting the amount of Crop Yield based on the amount of Rainfall Rainfall (X) CropYield(Y) Regression Line
  • 25. Intuition behind the Regression line Lets consider a sample dataset with 5 rows and find out how to draw the regression line X Y 1 2 2 4 3 5 4 4 5 5 Independent variable Dependent variable Plotting the data points
  • 26. Intuition behind the Regression line Calculate the mean of X and Y and plot the values X Y 1 2 2 4 3 5 4 4 5 5 Independent variable Dependent variable Plotting the mean of X and Y Mean 3 4
  • 27. Intuition behind the Regression line Regression line should ideally pass through the mean of X and Y X Y 1 2 2 4 3 5 4 4 5 5 Independent variable Dependent variable Regression line Mean 3 4 (3,4)
  • 28. Intuition behind the Regression line Drawing the equation of the Regression line _ _ _ X Y (X ) (Y ) (X Y) 1 2 1 4 2 2 4 4 16 8 3 5 9 25 15 4 4 16 16 16 5 5 25 25 25 = 66 Linear equation is represented as Y = m X + c =m = * Y = m X + c = 0.6 3 + 2.2 = 4 * 2 2 = 55 = 86 * = 15 = 20 c= * ((n (X Y))-( (X) (Y))*** ((n (X ))-( (X) )* 2 2 ((5 66)-(15 20))* * ((5 55))-(225)* =0.6 (( (Y) (X ))-( (X) (X Y)* 2 * * ((n (X ))-( (X) )* 2 2 = 2.2
  • 29. Intuition behind the Regression line Lets find out the predicted values of Y for corresponding values of X using the linear equation where m=0.6 and c=2.2 Here the blue points represent the actual Y values and the brown points represent the predicted Y values. The distance between the actual and predicted values are known as residuals or errors. The best fit line should have the least sum of squares of these errors also known as e square. (3,4) Y Y=0.6 1+2.2=2.8 Y=0.6 2+2.2=3.4 Y=0.6 3+2.2=4 Y=0.6 4+2.2=4.6 Y=0.6 5+2.2=5.2 pred * * * * *
  • 30. Intuition behind the Regression line Lets find out the predicted values of Y for corresponding values of X using the linear equation where m=0.6 and c=2.2 (3,4) _ _ X Y Y (Y-Y ) (Y-Y ) 1 2 2.8 -0.8 0.64 2 4 3.4 0.6 0.36 3 5 4 1 1 4 4 4.6 -0.6 0.36 5 5 5.2 -0.2 0.04 = 2.4 pred pred pred 2 The sum of squared errors for this regression line is 2.4. We check this error for each line and conclude the best fit line having the least e square value.
  • 31. Finding the Best fit line Minimizing the Distance: There are lots of ways to minimize the distance between the line and the data points like Sum of Squared errors, Sum of Absolute errors, Root Mean Square error etc. We keep moving this line through the data points to make sure the Best fit line has the least square distance between the data points and the regression line
  • 33. Multiple Linear Regression Simple Linear Regression Multiple Linear Regression Y = m x + c* 2 * Y = m x + m x + m x + ………. + m x + c*1 1 * 2 3 3*2 n n* Independent variables (IDV’s) Dependent variable (DV) Coefficient nm1, m2, m3…..m Slopes
  • 35. Use case implementation of Linear Regression Let’s understand how Multiple Linear Regression works by implementing it in Python
  • 36. Use case implementation of Linear Regression 1000 Companies Profit Expenditure Based on Predict
  • 37. Use case implementation of Linear Regression Predicting Profit of 1000 companies based on the attributes mentioned in the figure: Profit Estimation
  • 38. Use case implementation of Linear Regression Predicting Profit of 1000 companies based on the attributes mentioned in the figure: R&D Spend 1 Profit Estimation
  • 39. Use case implementation of Linear Regression Predicting Profit of 1000 companies based on the attributes mentioned in the figure: R&D Spend 1 Administration 2 Profit Estimation
  • 40. Use case implementation of Linear Regression Predicting Profit of 1000 companies based on the attributes mentioned in the figure: R&D Spend 1 Marketing Spend 3 Administration 2 Profit Estimation
  • 41. Use case implementation of Linear Regression Predicting Profit of 1000 companies based on the attributes mentioned in the figure: R&D Spend 1 State 4 Marketing Spend 3 Administration 2 Profit Estimation
  • 42. Use case implementation of Linear Regression Predicting Profit of 1000 companies based on the attributes mentioned in the figure: R&D Spend 1 State 4 Marketing Spend 3 Administration 2 ProfitProfit Profit Estimation
  • 43. Use case implementation of Linear Regression Predicting Profit of 1000 companies based on the attributes mentioned in the figure: R&D Spend 1 State 4 Marketing Spend 3 Administration 2 ProfitProfit Profit Estimation Predict Profit
  • 44. Use case implementation of Linear Regression 1. Import the libraries:
  • 45. Use case implementation of Linear Regression 2. Load the Dataset and extract independent and dependent variables:
  • 46. Use case implementation of Linear Regression 3. Data Visualization:
  • 47. Use case implementation of Linear Regression 4. Encoding Categorical Data: 5. Avoiding Dummy Variable Trap:
  • 48. Use case implementation of Linear Regression 6. Splitting the data into Train and Test set: 7. Fitting Multiple Linear Regression Model to Training set:
  • 49. Use case implementation of Linear Regression 8. Predicting the Test set results:
  • 50. Use case implementation of Linear Regression 9. Calculating the Coefficients and Intercepts:
  • 51. Use case implementation of Linear Regression 10. Evaluating the model: R squared value of 0.91 proves the model is a good model
  • 52. Use case summary We successfully trained our model with certain predictors and estimated the profit of companies using linear regression

Editor's Notes

  1. Style - 01
  2. Style - 01
  3. Style - 01
  4. Style - 01
  5. Style - 01
  6. Style - 01
  7. Style - 01
  8. Style - 01
  9. Style - 01
  10. Style - 01
  11. Style - 01
  12. Style - 01
  13. Style - 01
  14. Style - 01
  15. Style - 01
  16. Style - 01
  17. Style - 01
  18. Style - 01
  19. Style - 01
  20. Style - 01
  21. Style - 01
  22. Style - 01
  23. Style - 01
  24. Style - 01
  25. Style - 01
  26. Style - 01
  27. Style - 01
  28. Style - 01
  29. Style - 01
  30. Style - 01
  31. Style - 01
  32. Style - 01
  33. Style - 01
  34. Style - 01
  35. Style - 01
  36. Style - 01
  37. Style - 01
  38. Style - 01
  39. Style - 01
  40. Style - 01
  41. Style - 01
  42. Style - 01
  43. Style - 01
  44. Style - 01
  45. Style - 01
  46. Style - 01
  47. Style - 01
  48. Style - 01