SlideShare a Scribd company logo
1 of 47
Download to read offline
Lecture 2: Linear regression
Machine Learning Course
MIPT, 2019
1. Overview of linear models.
2. Linear regression.
3. Analytical solution.
4. Regularization.
5. Gauss-Markov theorem.
6. Probabilistic interpretation and intuition.
Outline
2
3
4
Example questions linear regression can solve (up
right picture):
● What will be my monthly spending for the next
year?
● Which factor is more important in deciding my
monthly spending?
● How monthly income and trips per month are
correlated with monthly spending?
5
Linear models
6
● Predictive models:
Linear models
7
● Predictive models:
● Classification models:
Linear models
8
● Predictive models:
● Classification models:
● Unsupervised models (e.g. PCA analysis)
Linear models
9
● Predictive models:
● Classification models:
● Unsupervised models (e.g. PCA analysis)
● Building block of other models (ensembles, NNs, etc.)
Linear models
10
● Predictive models:
● Classification models:
● Unsupervised models (e.g. PCA analysis)
● Building block of other models (ensembles, NNs, etc.)
Linear models
Actually, it’s a neural network. We will meet it later.
11
Linear regression
Linear regression problem statement:
● Training set , where .
12
Linear regression
Linear regression problem statement:
● Training set , where .
● Prediction model is linear: ,
Where is weights vector, is bias term.
13
Linear regression
Linear regression problem statement:
● Training set , where .
● Prediction model is linear: ,
Where is weights vector, is bias term.
● Least squares method provides a solution:
14
Analytical solution
Denote quadratic loss function: ,
where , .
15
Analytical solution
Denote quadratic loss function: ,
where , .
To find optimal solution let’s equal to zero the derivative of the equation above:
16
Analytical solution
Denote quadratic loss function: ,
where , .
To find optimal solution let’s equal to zero the derivative of the equation above:
17
Analytical solution
Denote quadratic loss function: ,
where , .
To find optimal solution let’s equal to zero the derivative of the equation above:
18
Analytical solution
Denote quadratic loss function: ,
where , .
To find optimal solution let’s equal to zero the derivative of the equation above:
So the target vector w should be
19
Analytical solution
Denote quadratic loss function: ,
where , .
To find optimal solution let’s equal to zero the derivative of the equation above:
So the target vector w should be
what if this matrix is singular?
20
Unstable solution
In case of multicollinear features the matrix is almost singular .
It leads to unstable solution:
21
Unstable solution
In case of multicollinear features the matrix is almost singular .
It leads to unstable solution:
22
Unstable solution
In case of multicollinear features the matrix is almost singular .
It leads to unstable solution:
the coefficients are huge and sum up to almost 0
23
Regularization
To make the matrix nonsingular, we can add a diagonal matrix:
,
where .
Actually, it’s a solution for the case .
24
Regularization
To make the matrix nonsingular, we can add a diagonal matrix:
,
where .
Actually, it’s a solution for the case .
exercise: check it by yourself
25
Regularization
To make the matrix nonsingular, we can add a diagonal matrix:
,
where .
Actually, it’s a solution for the case .
Let , where is vector of error random variables.
26
Gauss-Markov theorem
Let , where is vector of error random variables.
The Gauss–Markov assumptions concern the set of error random variables:
27
Gauss-Markov theorem
28
Gauss-Markov theorem
Let , where is vector of error random variables.
The Gauss–Markov assumptions concern the set of error random variables:
● They have zero mean:
29
Gauss-Markov theorem
Let , where is vector of error random variables.
The Gauss–Markov assumptions concern the set of error random variables:
● They have zero mean:
● They are homoscedastic, that is all have the same finite variance:
30
Gauss-Markov theorem
Let , where is vector of error random variables.
The Gauss–Markov assumptions concern the set of error random variables:
● They have zero mean:
● They are homoscedastic, that is all have the same finite variance:
● Distinct error terms are uncorrelated:
31
Gauss-Markov theorem
Let , where is vector of error random variables.
The Gauss–Markov assumptions concern the set of error random variables:
● They have zero mean:
● They are homoscedastic, that is all have the same finite variance:
● Distinct error terms are uncorrelated:
Then the solution delivers BLEU: Best Linear Unbiased Estimator.
Once more: loss functions:
●
32
Regularization terms:
● :
Different norms
Once more: loss functions:
●
●
33
Regularization terms:
● :
● :
Different norms
Once more: loss functions:
●
●
34
Regularization terms:
● :
● :
Different norms
only works for Gauss-Markov theorem
35
What’s the difference?
36
What’s the difference?
● MSE
○ delivers BLUE according to
Gauss-Markov theorem
○ differentiable
○ sensitive to noise
37
What’s the difference?
● MSE
○ delivers BLUE according to
Gauss-Markov theorem
○ differentiable
○ sensitive to noise
● MAE
○ non-differentiable
■ (actually, it is differentiable)
○ much more prone to noise
38
What’s the difference?
● MSE
○ delivers BLUE according to
Gauss-Markov theorem
○ differentiable
○ sensitive to noise
● MAE
○ non-differentiable
■ (actually, it is differentiable)
○ much more prone to noise
● regularization
○ constraints weights
○ delivers more stable solution
○ Differentiable
39
What’s the difference?
● MSE
○ delivers BLUE according to
Gauss-Markov theorem
○ differentiable
○ sensitive to noise
● MAE
○ non-differentiable
■ (actually, it is differentiable)
○ much more prone to noise
● regularization
○ constraints weights
○ delivers more stable solution
○ Differentiable
● regularization
○ non-differentiable
■ (actually, the same as MAE ;)
○ selects features
40
What’s the difference?
● MSE
○ delivers BLUE according to
Gauss-Markov theorem
○ differentiable
○ sensitive to noise
● MAE
○ non-differentiable
■ (actually, it is differentiable)
○ much more prone to noise
● regularization
○ constraints weights
○ delivers more stable solution
○ Differentiable
● regularization
○ non-differentiable
■ (actually, the same as MAE ;)
○ selects features
Does what?
41
source: Modern Multivariate Statistical Techniques
Regularization: illustration
42
source: Modern Multivariate Statistical Techniques
regularization regularization
Regularization: illustration
43
Regularization: probability interpretation
assume w elements
are sampled from
some specific
distribution (prior
distribution for the
weights vector)
44
regularization
Regularization: probability interpretation
regularization
assume w elements
are sampled from
some specific
distribution (prior
distribution for the
weights vector)
45
regularization
Regularization: probability interpretation
regularization
see seminar extra materials for more
assume w elements
are sampled from
some specific
distribution (prior
distribution for the
weights vector)
Welcome to the church of Bayes
46
church of Bayes
Дмитрий Ветров - заведующий Международной лабораторией глубинного обучения и байесовских методов
That’s all. Practice coming next.

More Related Content

Similar to lecture02_LinearRegression.pdf

Chapter 4 EIgen values and eigen vectors.pptx
Chapter 4 EIgen values and eigen vectors.pptxChapter 4 EIgen values and eigen vectors.pptx
Chapter 4 EIgen values and eigen vectors.pptxTamilSelvi165
 
10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptxshyedshahriar
 
Linear Classification
Linear ClassificationLinear Classification
Linear Classificationmailund
 
Linear algebra application in linear programming
Linear algebra application in linear programming Linear algebra application in linear programming
Linear algebra application in linear programming Lahiru Dilshan
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)irjes
 
Lecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptxLecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptxSunny432360
 
Probabilistic Models of Time Series and Sequences
Probabilistic Models of Time Series and SequencesProbabilistic Models of Time Series and Sequences
Probabilistic Models of Time Series and SequencesZitao Liu
 
Solving linear equations by graphing
Solving linear equations by graphingSolving linear equations by graphing
Solving linear equations by graphingnmmccarry
 
Matrix Factorisation (and Dimensionality Reduction)
Matrix Factorisation (and Dimensionality Reduction)Matrix Factorisation (and Dimensionality Reduction)
Matrix Factorisation (and Dimensionality Reduction)HJ van Veen
 
A General Purpose Exact Solution Method For Mixed Integer Concave Minimizatio...
A General Purpose Exact Solution Method For Mixed Integer Concave Minimizatio...A General Purpose Exact Solution Method For Mixed Integer Concave Minimizatio...
A General Purpose Exact Solution Method For Mixed Integer Concave Minimizatio...Martha Brown
 
Direct Methods to Solve Lineal Equations
Direct Methods to Solve Lineal EquationsDirect Methods to Solve Lineal Equations
Direct Methods to Solve Lineal EquationsLizeth Paola Barrero
 
Direct Methods to Solve Linear Equations Systems
Direct Methods to Solve Linear Equations SystemsDirect Methods to Solve Linear Equations Systems
Direct Methods to Solve Linear Equations SystemsLizeth Paola Barrero
 
Business Analytics Foundation with R Tools Part 1
Business Analytics Foundation with R Tools Part 1Business Analytics Foundation with R Tools Part 1
Business Analytics Foundation with R Tools Part 1Beamsync
 
1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmr1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmrAdam Lee Perelman
 

Similar to lecture02_LinearRegression.pdf (20)

Chapter 4 EIgen values and eigen vectors.pptx
Chapter 4 EIgen values and eigen vectors.pptxChapter 4 EIgen values and eigen vectors.pptx
Chapter 4 EIgen values and eigen vectors.pptx
 
10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx10_support_vector_machines (1).pptx
10_support_vector_machines (1).pptx
 
Linear Classification
Linear ClassificationLinear Classification
Linear Classification
 
Linear algebra application in linear programming
Linear algebra application in linear programming Linear algebra application in linear programming
Linear algebra application in linear programming
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)
 
6260966
62609666260966
6260966
 
MF Presentation.pptx
MF Presentation.pptxMF Presentation.pptx
MF Presentation.pptx
 
Lecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptxLecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptx
 
2- Introduction to Modeling.pdf
2- Introduction to Modeling.pdf2- Introduction to Modeling.pdf
2- Introduction to Modeling.pdf
 
Probabilistic Models of Time Series and Sequences
Probabilistic Models of Time Series and SequencesProbabilistic Models of Time Series and Sequences
Probabilistic Models of Time Series and Sequences
 
ders 7.1 VAR.pptx
ders 7.1 VAR.pptxders 7.1 VAR.pptx
ders 7.1 VAR.pptx
 
Solving linear equations by graphing
Solving linear equations by graphingSolving linear equations by graphing
Solving linear equations by graphing
 
Matrix Factorisation (and Dimensionality Reduction)
Matrix Factorisation (and Dimensionality Reduction)Matrix Factorisation (and Dimensionality Reduction)
Matrix Factorisation (and Dimensionality Reduction)
 
A General Purpose Exact Solution Method For Mixed Integer Concave Minimizatio...
A General Purpose Exact Solution Method For Mixed Integer Concave Minimizatio...A General Purpose Exact Solution Method For Mixed Integer Concave Minimizatio...
A General Purpose Exact Solution Method For Mixed Integer Concave Minimizatio...
 
Direct Methods to Solve Lineal Equations
Direct Methods to Solve Lineal EquationsDirect Methods to Solve Lineal Equations
Direct Methods to Solve Lineal Equations
 
Direct methods
Direct methodsDirect methods
Direct methods
 
Direct Methods to Solve Linear Equations Systems
Direct Methods to Solve Linear Equations SystemsDirect Methods to Solve Linear Equations Systems
Direct Methods to Solve Linear Equations Systems
 
Direct methods
Direct methodsDirect methods
Direct methods
 
Business Analytics Foundation with R Tools Part 1
Business Analytics Foundation with R Tools Part 1Business Analytics Foundation with R Tools Part 1
Business Analytics Foundation with R Tools Part 1
 
1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmr1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmr
 

More from YuChianWu

lecture04_mle_svm_multiclass_pca.pdf
lecture04_mle_svm_multiclass_pca.pdflecture04_mle_svm_multiclass_pca.pdf
lecture04_mle_svm_multiclass_pca.pdfYuChianWu
 
week13_yolo_mobilenet.pdf
week13_yolo_mobilenet.pdfweek13_yolo_mobilenet.pdf
week13_yolo_mobilenet.pdfYuChianWu
 
week14_segmentation.pdf
week14_segmentation.pdfweek14_segmentation.pdf
week14_segmentation.pdfYuChianWu
 
week10_Reinforce.pdf
week10_Reinforce.pdfweek10_Reinforce.pdf
week10_Reinforce.pdfYuChianWu
 
week12_cv_intro_and_r-cnn.pdf
week12_cv_intro_and_r-cnn.pdfweek12_cv_intro_and_r-cnn.pdf
week12_cv_intro_and_r-cnn.pdfYuChianWu
 
Fragattacks-Breaking-Wi-Fi-Through-Fragmentation-And-Aggregation.pdf
Fragattacks-Breaking-Wi-Fi-Through-Fragmentation-And-Aggregation.pdfFragattacks-Breaking-Wi-Fi-Through-Fragmentation-And-Aggregation.pdf
Fragattacks-Breaking-Wi-Fi-Through-Fragmentation-And-Aggregation.pdfYuChianWu
 
Im-A-Hacker-Get-Me-Out-Of-Here-Breaking-Network-Segregation-Using-Esoteric-Co...
Im-A-Hacker-Get-Me-Out-Of-Here-Breaking-Network-Segregation-Using-Esoteric-Co...Im-A-Hacker-Get-Me-Out-Of-Here-Breaking-Network-Segregation-Using-Esoteric-Co...
Im-A-Hacker-Get-Me-Out-Of-Here-Breaking-Network-Segregation-Using-Esoteric-Co...YuChianWu
 
Lets-Attack-Lets_Encrypt.pdf
Lets-Attack-Lets_Encrypt.pdfLets-Attack-Lets_Encrypt.pdf
Lets-Attack-Lets_Encrypt.pdfYuChianWu
 
A-Hole-in-the-Tube.pdf
A-Hole-in-the-Tube.pdfA-Hole-in-the-Tube.pdf
A-Hole-in-the-Tube.pdfYuChianWu
 
IPvSeeYou.pdf
IPvSeeYou.pdfIPvSeeYou.pdf
IPvSeeYou.pdfYuChianWu
 
kolmogorov_foundations.pdf
kolmogorov_foundations.pdfkolmogorov_foundations.pdf
kolmogorov_foundations.pdfYuChianWu
 
Introductory Real Analysis (A. N. Kolmogorov, S. V. Fomin etc.) (z-lib.org).pdf
Introductory Real Analysis (A. N. Kolmogorov, S. V. Fomin etc.) (z-lib.org).pdfIntroductory Real Analysis (A. N. Kolmogorov, S. V. Fomin etc.) (z-lib.org).pdf
Introductory Real Analysis (A. N. Kolmogorov, S. V. Fomin etc.) (z-lib.org).pdfYuChianWu
 

More from YuChianWu (12)

lecture04_mle_svm_multiclass_pca.pdf
lecture04_mle_svm_multiclass_pca.pdflecture04_mle_svm_multiclass_pca.pdf
lecture04_mle_svm_multiclass_pca.pdf
 
week13_yolo_mobilenet.pdf
week13_yolo_mobilenet.pdfweek13_yolo_mobilenet.pdf
week13_yolo_mobilenet.pdf
 
week14_segmentation.pdf
week14_segmentation.pdfweek14_segmentation.pdf
week14_segmentation.pdf
 
week10_Reinforce.pdf
week10_Reinforce.pdfweek10_Reinforce.pdf
week10_Reinforce.pdf
 
week12_cv_intro_and_r-cnn.pdf
week12_cv_intro_and_r-cnn.pdfweek12_cv_intro_and_r-cnn.pdf
week12_cv_intro_and_r-cnn.pdf
 
Fragattacks-Breaking-Wi-Fi-Through-Fragmentation-And-Aggregation.pdf
Fragattacks-Breaking-Wi-Fi-Through-Fragmentation-And-Aggregation.pdfFragattacks-Breaking-Wi-Fi-Through-Fragmentation-And-Aggregation.pdf
Fragattacks-Breaking-Wi-Fi-Through-Fragmentation-And-Aggregation.pdf
 
Im-A-Hacker-Get-Me-Out-Of-Here-Breaking-Network-Segregation-Using-Esoteric-Co...
Im-A-Hacker-Get-Me-Out-Of-Here-Breaking-Network-Segregation-Using-Esoteric-Co...Im-A-Hacker-Get-Me-Out-Of-Here-Breaking-Network-Segregation-Using-Esoteric-Co...
Im-A-Hacker-Get-Me-Out-Of-Here-Breaking-Network-Segregation-Using-Esoteric-Co...
 
Lets-Attack-Lets_Encrypt.pdf
Lets-Attack-Lets_Encrypt.pdfLets-Attack-Lets_Encrypt.pdf
Lets-Attack-Lets_Encrypt.pdf
 
A-Hole-in-the-Tube.pdf
A-Hole-in-the-Tube.pdfA-Hole-in-the-Tube.pdf
A-Hole-in-the-Tube.pdf
 
IPvSeeYou.pdf
IPvSeeYou.pdfIPvSeeYou.pdf
IPvSeeYou.pdf
 
kolmogorov_foundations.pdf
kolmogorov_foundations.pdfkolmogorov_foundations.pdf
kolmogorov_foundations.pdf
 
Introductory Real Analysis (A. N. Kolmogorov, S. V. Fomin etc.) (z-lib.org).pdf
Introductory Real Analysis (A. N. Kolmogorov, S. V. Fomin etc.) (z-lib.org).pdfIntroductory Real Analysis (A. N. Kolmogorov, S. V. Fomin etc.) (z-lib.org).pdf
Introductory Real Analysis (A. N. Kolmogorov, S. V. Fomin etc.) (z-lib.org).pdf
 

Recently uploaded

Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 

Recently uploaded (20)

Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 

lecture02_LinearRegression.pdf

  • 1. Lecture 2: Linear regression Machine Learning Course MIPT, 2019
  • 2. 1. Overview of linear models. 2. Linear regression. 3. Analytical solution. 4. Regularization. 5. Gauss-Markov theorem. 6. Probabilistic interpretation and intuition. Outline 2
  • 3. 3
  • 4. 4 Example questions linear regression can solve (up right picture): ● What will be my monthly spending for the next year? ● Which factor is more important in deciding my monthly spending? ● How monthly income and trips per month are correlated with monthly spending?
  • 7. 7 ● Predictive models: ● Classification models: Linear models
  • 8. 8 ● Predictive models: ● Classification models: ● Unsupervised models (e.g. PCA analysis) Linear models
  • 9. 9 ● Predictive models: ● Classification models: ● Unsupervised models (e.g. PCA analysis) ● Building block of other models (ensembles, NNs, etc.) Linear models
  • 10. 10 ● Predictive models: ● Classification models: ● Unsupervised models (e.g. PCA analysis) ● Building block of other models (ensembles, NNs, etc.) Linear models Actually, it’s a neural network. We will meet it later.
  • 11. 11 Linear regression Linear regression problem statement: ● Training set , where .
  • 12. 12 Linear regression Linear regression problem statement: ● Training set , where . ● Prediction model is linear: , Where is weights vector, is bias term.
  • 13. 13 Linear regression Linear regression problem statement: ● Training set , where . ● Prediction model is linear: , Where is weights vector, is bias term. ● Least squares method provides a solution:
  • 14. 14 Analytical solution Denote quadratic loss function: , where , .
  • 15. 15 Analytical solution Denote quadratic loss function: , where , . To find optimal solution let’s equal to zero the derivative of the equation above:
  • 16. 16 Analytical solution Denote quadratic loss function: , where , . To find optimal solution let’s equal to zero the derivative of the equation above:
  • 17. 17 Analytical solution Denote quadratic loss function: , where , . To find optimal solution let’s equal to zero the derivative of the equation above:
  • 18. 18 Analytical solution Denote quadratic loss function: , where , . To find optimal solution let’s equal to zero the derivative of the equation above: So the target vector w should be
  • 19. 19 Analytical solution Denote quadratic loss function: , where , . To find optimal solution let’s equal to zero the derivative of the equation above: So the target vector w should be what if this matrix is singular?
  • 20. 20 Unstable solution In case of multicollinear features the matrix is almost singular . It leads to unstable solution:
  • 21. 21 Unstable solution In case of multicollinear features the matrix is almost singular . It leads to unstable solution:
  • 22. 22 Unstable solution In case of multicollinear features the matrix is almost singular . It leads to unstable solution: the coefficients are huge and sum up to almost 0
  • 23. 23 Regularization To make the matrix nonsingular, we can add a diagonal matrix: , where . Actually, it’s a solution for the case .
  • 24. 24 Regularization To make the matrix nonsingular, we can add a diagonal matrix: , where . Actually, it’s a solution for the case . exercise: check it by yourself
  • 25. 25 Regularization To make the matrix nonsingular, we can add a diagonal matrix: , where . Actually, it’s a solution for the case .
  • 26. Let , where is vector of error random variables. 26 Gauss-Markov theorem
  • 27. Let , where is vector of error random variables. The Gauss–Markov assumptions concern the set of error random variables: 27 Gauss-Markov theorem
  • 28. 28 Gauss-Markov theorem Let , where is vector of error random variables. The Gauss–Markov assumptions concern the set of error random variables: ● They have zero mean:
  • 29. 29 Gauss-Markov theorem Let , where is vector of error random variables. The Gauss–Markov assumptions concern the set of error random variables: ● They have zero mean: ● They are homoscedastic, that is all have the same finite variance:
  • 30. 30 Gauss-Markov theorem Let , where is vector of error random variables. The Gauss–Markov assumptions concern the set of error random variables: ● They have zero mean: ● They are homoscedastic, that is all have the same finite variance: ● Distinct error terms are uncorrelated:
  • 31. 31 Gauss-Markov theorem Let , where is vector of error random variables. The Gauss–Markov assumptions concern the set of error random variables: ● They have zero mean: ● They are homoscedastic, that is all have the same finite variance: ● Distinct error terms are uncorrelated: Then the solution delivers BLEU: Best Linear Unbiased Estimator.
  • 32. Once more: loss functions: ● 32 Regularization terms: ● : Different norms
  • 33. Once more: loss functions: ● ● 33 Regularization terms: ● : ● : Different norms
  • 34. Once more: loss functions: ● ● 34 Regularization terms: ● : ● : Different norms only works for Gauss-Markov theorem
  • 36. 36 What’s the difference? ● MSE ○ delivers BLUE according to Gauss-Markov theorem ○ differentiable ○ sensitive to noise
  • 37. 37 What’s the difference? ● MSE ○ delivers BLUE according to Gauss-Markov theorem ○ differentiable ○ sensitive to noise ● MAE ○ non-differentiable ■ (actually, it is differentiable) ○ much more prone to noise
  • 38. 38 What’s the difference? ● MSE ○ delivers BLUE according to Gauss-Markov theorem ○ differentiable ○ sensitive to noise ● MAE ○ non-differentiable ■ (actually, it is differentiable) ○ much more prone to noise ● regularization ○ constraints weights ○ delivers more stable solution ○ Differentiable
  • 39. 39 What’s the difference? ● MSE ○ delivers BLUE according to Gauss-Markov theorem ○ differentiable ○ sensitive to noise ● MAE ○ non-differentiable ■ (actually, it is differentiable) ○ much more prone to noise ● regularization ○ constraints weights ○ delivers more stable solution ○ Differentiable ● regularization ○ non-differentiable ■ (actually, the same as MAE ;) ○ selects features
  • 40. 40 What’s the difference? ● MSE ○ delivers BLUE according to Gauss-Markov theorem ○ differentiable ○ sensitive to noise ● MAE ○ non-differentiable ■ (actually, it is differentiable) ○ much more prone to noise ● regularization ○ constraints weights ○ delivers more stable solution ○ Differentiable ● regularization ○ non-differentiable ■ (actually, the same as MAE ;) ○ selects features Does what?
  • 41. 41 source: Modern Multivariate Statistical Techniques Regularization: illustration
  • 42. 42 source: Modern Multivariate Statistical Techniques regularization regularization Regularization: illustration
  • 43. 43 Regularization: probability interpretation assume w elements are sampled from some specific distribution (prior distribution for the weights vector)
  • 44. 44 regularization Regularization: probability interpretation regularization assume w elements are sampled from some specific distribution (prior distribution for the weights vector)
  • 45. 45 regularization Regularization: probability interpretation regularization see seminar extra materials for more assume w elements are sampled from some specific distribution (prior distribution for the weights vector)
  • 46. Welcome to the church of Bayes 46 church of Bayes Дмитрий Ветров - заведующий Международной лабораторией глубинного обучения и байесовских методов
  • 47. That’s all. Practice coming next.