SlideShare a Scribd company logo
Seminar Series on
Linear Algebra for Machine Learning
Part 4: Eigenvalues, Eigenvectors and
Diagonalization
Dr. Ceni Babaoglu
Data Science Laboratory
Ryerson University
cenibabaoglu.com
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Overview
1 Eigenvalues and eigenvectors
2 Some properties of eigenvalues and eigenvectors
3 Similar matrices
4 Diagonalizable matrices
5 Some properties of diagonalizable matrices
6 References
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Eigenvalues and Eigenvectors
When a matrix multiplies a vector in general the magnitude
and direction of the vector will change.
There are special vectors where only their magnitude is
changed when multiplied by a matrix.
These special vectors are called eigenvectors. The value by
which the length changes is the associated eigenvalue.
We say that x is an eigenvector of A if
Ax = λx.
λ is called the associated eigenvalue.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Eigenvalues and Eigenvectors
The matrix A transforms 5 different vectors to other 5
different vectors. Vector (1) is transformed to vector (a),
vector (2) is transformed to vector (b) and so on.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Eigenvalues and Eigenvectors
All the vectors except vector (4) change both their magnitude
and direction when transformed by A.
Vector (4) changes only magnitude and does not change
direction.
Vector (4) is an eigenvector of A.
λ =
Magnitude of vector (d)
Magnitude of vector (4)
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Eigenvalues and Eigenvectors
In this mapping the red arrow changes direction but the blue
arrow does not. The blue arrow is an eigenvector of this
mapping because it does not change direction, and since its
length is unchanged, its eigenvalue is 1.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Some properties
If λ1, λ2, · · · , λn are distinct eigenvalues of a matrix, then the
corresponding eigenvectors e1, e2, · · · , en are linearly
independent.
If e1 is an eigenvector of a matrix with corresponding
eigenvalue λ1, then any nonzero scalar multiple of e1 is also
an eigenvector with eigenvalue λ1.
A real, symmetric square matrix has real eigenvalues, with
orthogonal eigenvectors (can be chosen to be orthonormal).
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Some properties
The equation Ax = λx can be written in the form
(A − λI)x = 0 (1)
λ is an eigenvalue of A if and only if (1) has a nontrivial
solution.
(1) has nontrivial solution if and only if A − λI is singular, or
equivalently
det(A − λI) = 0 → characteristic equation for A (2)
If (2) is expanded, we obtain an nth degree polynomial in λ,
p(λ) = det(A − λI) → characteristic polynomial
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Similar Matrices
A matrix B is said to be similar to a matrix A if there exists a
nonsingular matrix S such that
B = S−1
AS.
For n × n matrices A and B, if A is similar to B, then the two
matrices both have the same characteristic polynomial and,
consequently, both have the same eigenvalues.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Diagonalizable Matrices
An n × n matrix A is said to be diagonalizable if there exists a
nonsingular matrix X and a diagonal matrix D such that
X−1
AX = D.
We say that X diagonalizes A.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Some Properties
An n × n matrix A is diagonalizable if and only if A has n
linearly independent eigenvectors.
If A is diagonalizable, then the column vectors of the
diagonalizing matrix X are eigenvectors of A and the diagonal
elements of D are the corresponding eigenvalues of A.
The diagonalizing matrix X is not unique. Reordering the
columns of a given diagonalizing matrix X or multiplying them
by nonzero scalars will produce a new diagonalizing matrix.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Some Properties
If an n × n matrix A has n distinct eigenvalues, then A is
diagonalizable.
If the eigenvalues are not distinct, then A may or may not be
diagonalizable, depending on whether A has n linearly
independent eigenvectors.
If A is diagonalizable, then A can be factored into a product
XDX−1
.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Some Properties
All the roots of the characteristic polynomial of a symmetric
matrix are real numbers.
If A is a symmetric matrix, then eigenvectors that belong to
distinct eigenvalues of A are orthogonal.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Example
Diagonalize the matrix A =


2 −2 3
1 1 1
1 3 −1


We should solve the equation |A − λI| = 0.
|A − λI| =
2 − λ −2 3
1 1 − λ 1
1 3 −1 − λ
R2−R3→R2
−−−−−−−→
2 − λ −2 3
0 −2 − λ 2 + λ
1 3 −1 − λ
= (2 + λ)
2 − λ −2 3
0 −1 1
1 3 −1 − λ
C2+C3→C2
−−−−−−−→ (2 + λ)
2 − λ 1 3
0 0 1
1 2 − λ −1 − λ
= −(2 + λ)
2 − λ 1
1 2 − λ
= −(2 + λ)[(2 − λ)2
− 1] = −(2 + λ)(λ2
− 4λ + 3) = 0.
Eigenvalues: λ1 = 1, λ2 = 3, λ3 = −2.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Example
A =


2 −2 3
1 1 1
1 3 −1


We solve the equation |A − λI| = 0.
Eigenvalues: λ1 = 1, λ2 = 3, λ3 = −2.
The 3 × 3 matrix A has 3 distinct real eigenvalues.
It has 3 linearly independent eigenvectors which implies A is
diagonalizable.
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Example
To find the eigenvector corresponding to λ1 = 1, we solve the
homogeneous system (A − λ1I) u = 0.
(A − I) u = 0 ⇒


1 −2 3
1 0 1
1 3 −2

 ·


u1
u2
u3

 = 0
⇒


1 −2 3
1 0 1
1 3 −2


R2−R1→R2
R3−R1→R3
−−−−−−−→


1 −2 3
0 2 −2
0 5 −5


R2/2→R2
R3/5→R3
−−−−−→


1 −2 3
0 1 −1
0 1 −1


R1+2R2→R1
R3−R2→R3
−−−−−−−→


1 0 1
0 1 −1
0 0 0


⇒ u1 + u3 = 0 u2 − u3 = 0
⇒ u1 = −u2 = −u3 = α
An eigenvector corresponding to λ1 = 1 is


−1
1
1


Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Example
To find the eigenvector corresponding to λ2 = 3, we solve the
homogeneous system (A − λ2I) v = 0.
⇒ (A − 3I) v = 0
⇒


−1 −2 3
1 −2 1
1 3 −4

 ·


v1
v2
v3

 = 0
⇒


−1 −2 3
1 −2 1
1 3 −4


R2+R1→R2
R3+R1→R3
−−−−−−−→


−1 −2 3
0 −4 4
0 1 −1


−R1→R1
−R2/4→R2
−−−−−−−→


1 2 −3
0 1 −1
0 1 −1


R1−2R2→R1
R3−R2→R3
−−−−−−−→


1 0 −1
0 1 −1
0 0 0


⇒ v1 − v3 = 0 v2 − v3 = 0
⇒ v1 = v2 = v3 = α
An eigenvector corresponding to λ2 = 3 is


1
1
1


Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Example
To find the eigenspace corresponding to λ3 = −2, we solve
the homogeneous system (A − λ3I) w = 0.
⇒ (A + 2I) w = 0
⇒


4 −2 3
1 3 1
1 3 1

 ·


w1
w2
w3

 = 0
⇒


4 −2 3
1 3 1
1 3 1


R1−4R2→R1
R3−R2→R3
−−−−−−−→


0 −14 −1
1 3 1
0 0 0

 R1↔R2
−−−−→


1 3 1
0 −14 −1
0 0 0


−R2/14→R2
−−−−−−−→


1 3 1
0 1 1/14
0 0 0

 R1−3R2→R1
−−−−−−−→


1 0 11/14
0 1 1/14
0 0 0


⇒ w1 + 11w3/14 = 0 w2 + w3/14 = 0
⇒ w1 = 11α w2 = α w3 = −14α
An eigenvector corresponding to λ3 = −2 is


11
1
−14


Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
Example
X−1
AX = D


−1/2 5/6 −1/3
1/2 1/10 2/5
0 1/15 −1/15




2 −2 3
1 1 1
1 3 −1




−1 1 11
1 1 1
1 1 −14

 =


1 0 0
0 3 0
0 0 −2


A = XDX−1


2 −2 3
1 1 1
1 3 −1

 =


−1 1 11
1 1 1
1 1 −14




1 0 0
0 3 0
0 0 −2




−1/2 5/6 −1/3
1/2 1/10 2/5
0 1/15 −1/15


Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
References
Linear Algebra With Applications, 7th Edition
by Steven J. Leon.
Elementary Linear Algebra with Applications, 9th Edition
by Bernard Kolman and David Hill.
http://www.sharetechnote.com/html/Handbook_EngMath_Matrix_
Eigen.html
https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors
Dr. Ceni Babaoglu cenibabaoglu.com
Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization

More Related Content

What's hot

Linear algebra notes 1
Linear algebra notes 1Linear algebra notes 1
Linear algebra notes 1
Ghulam Murtaza
 
Diagonalization of matrix
Diagonalization of matrixDiagonalization of matrix
Diagonalization of matrix
VANDANASAINI29
 
Diagonalization of Matrices
Diagonalization of MatricesDiagonalization of Matrices
Diagonalization of Matrices
AmenahGondal1
 
Adjacency And Incidence Matrix
Adjacency And Incidence MatrixAdjacency And Incidence Matrix
Adjacency And Incidence Matrix
Abir Junayed
 
Graph theory
Graph theoryGraph theory
Graph theory
Thirunavukarasu Mani
 
System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
Diler4
 
Presentation on matrix
Presentation on matrixPresentation on matrix
Presentation on matrix
Nahin Mahfuz Seam
 
Eigen values and eigen vectors
Eigen values and eigen vectorsEigen values and eigen vectors
Eigen values and eigen vectors
Riddhi Patel
 
Gaussian Elimination Method
Gaussian Elimination MethodGaussian Elimination Method
Gaussian Elimination Method
Andi Firdaus
 
Eigen value and vectors
Eigen value and vectorsEigen value and vectors
Eigen value and vectors
Praveen Prashant
 
systems of linear equations & matrices
systems of linear equations & matricessystems of linear equations & matrices
systems of linear equations & matricesStudent
 
Lesson02 Vectors And Matrices Slides
Lesson02   Vectors And Matrices SlidesLesson02   Vectors And Matrices Slides
Lesson02 Vectors And Matrices SlidesMatthew Leingang
 
Linear Algebra and Matrix
Linear Algebra and MatrixLinear Algebra and Matrix
Linear Algebra and Matrixitutor
 
Determinants - Mathematics
Determinants - MathematicsDeterminants - Mathematics
Determinants - Mathematics
Drishti Bhalla
 
Fuzzy Set Theory
Fuzzy Set TheoryFuzzy Set Theory
Fuzzy Set TheoryAMIT KUMAR
 
Applications of linear algebra in field of it
Applications of linear algebra in field of itApplications of linear algebra in field of it
Applications of linear algebra in field of it
university of Gujrat, pakistan
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent method
Sanghyuk Chun
 
LinearAlgebra.ppt
LinearAlgebra.pptLinearAlgebra.ppt
LinearAlgebra.ppt
vijaykumar838577
 
Logistic regression in Machine Learning
Logistic regression in Machine LearningLogistic regression in Machine Learning
Logistic regression in Machine Learning
Kuppusamy P
 

What's hot (20)

Linear algebra notes 1
Linear algebra notes 1Linear algebra notes 1
Linear algebra notes 1
 
Diagonalization of matrix
Diagonalization of matrixDiagonalization of matrix
Diagonalization of matrix
 
Diagonalization of Matrices
Diagonalization of MatricesDiagonalization of Matrices
Diagonalization of Matrices
 
Adjacency And Incidence Matrix
Adjacency And Incidence MatrixAdjacency And Incidence Matrix
Adjacency And Incidence Matrix
 
Graph theory
Graph theoryGraph theory
Graph theory
 
System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
 
Presentation on matrix
Presentation on matrixPresentation on matrix
Presentation on matrix
 
Eigen values and eigen vectors
Eigen values and eigen vectorsEigen values and eigen vectors
Eigen values and eigen vectors
 
Maths
MathsMaths
Maths
 
Gaussian Elimination Method
Gaussian Elimination MethodGaussian Elimination Method
Gaussian Elimination Method
 
Eigen value and vectors
Eigen value and vectorsEigen value and vectors
Eigen value and vectors
 
systems of linear equations & matrices
systems of linear equations & matricessystems of linear equations & matrices
systems of linear equations & matrices
 
Lesson02 Vectors And Matrices Slides
Lesson02   Vectors And Matrices SlidesLesson02   Vectors And Matrices Slides
Lesson02 Vectors And Matrices Slides
 
Linear Algebra and Matrix
Linear Algebra and MatrixLinear Algebra and Matrix
Linear Algebra and Matrix
 
Determinants - Mathematics
Determinants - MathematicsDeterminants - Mathematics
Determinants - Mathematics
 
Fuzzy Set Theory
Fuzzy Set TheoryFuzzy Set Theory
Fuzzy Set Theory
 
Applications of linear algebra in field of it
Applications of linear algebra in field of itApplications of linear algebra in field of it
Applications of linear algebra in field of it
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent method
 
LinearAlgebra.ppt
LinearAlgebra.pptLinearAlgebra.ppt
LinearAlgebra.ppt
 
Logistic regression in Machine Learning
Logistic regression in Machine LearningLogistic regression in Machine Learning
Logistic regression in Machine Learning
 

Similar to 4. Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization

Eigen values and Eigen vectors ppt world
Eigen values and Eigen vectors ppt worldEigen values and Eigen vectors ppt world
Eigen values and Eigen vectors ppt world
raykoustav145
 
Sec 3.4 Eigen values and Eigen vectors.pptx
Sec 3.4 Eigen values and Eigen vectors.pptxSec 3.4 Eigen values and Eigen vectors.pptx
Sec 3.4 Eigen values and Eigen vectors.pptx
MohammedZahid47
 
Matlab eig
Matlab eigMatlab eig
Matlab eig
Ahmed Chegrani
 
5. Linear Algebra for Machine Learning: Singular Value Decomposition and Prin...
5. Linear Algebra for Machine Learning: Singular Value Decomposition and Prin...5. Linear Algebra for Machine Learning: Singular Value Decomposition and Prin...
5. Linear Algebra for Machine Learning: Singular Value Decomposition and Prin...
Ceni Babaoglu, PhD
 
Matrices ppt
Matrices pptMatrices ppt
Matrices ppt
aakashray33
 
Module 1 Theory of Matrices.pdf
Module 1 Theory of Matrices.pdfModule 1 Theory of Matrices.pdf
Module 1 Theory of Matrices.pdf
PrathamPatel560716
 
Spectral Clustering Report
Spectral Clustering ReportSpectral Clustering Report
Spectral Clustering ReportMiaolan Xie
 
Eigen-Decomposition: Eigenvalues and Eigenvectors.pdf
Eigen-Decomposition: Eigenvalues and Eigenvectors.pdfEigen-Decomposition: Eigenvalues and Eigenvectors.pdf
Eigen-Decomposition: Eigenvalues and Eigenvectors.pdf
NehaVerma933923
 
Tutorial on EM algorithm – Part 1
Tutorial on EM algorithm – Part 1Tutorial on EM algorithm – Part 1
Tutorial on EM algorithm – Part 1
Loc Nguyen
 
Eigen values and eigen vectors engineering
Eigen values and eigen vectors engineeringEigen values and eigen vectors engineering
Eigen values and eigen vectors engineering
shubham211
 
Power method
Power methodPower method
Power method
nashaat algrara
 
Deep learning book_chap_02
Deep learning book_chap_02Deep learning book_chap_02
Deep learning book_chap_02
HyeongGooKang
 
DOC-20231230-WA0001..pdf
DOC-20231230-WA0001..pdfDOC-20231230-WA0001..pdf
DOC-20231230-WA0001..pdf
SatyabrataMandal7
 
Numerical solution of eigenvalues and applications 2
Numerical solution of eigenvalues and applications 2Numerical solution of eigenvalues and applications 2
Numerical solution of eigenvalues and applications 2
SamsonAjibola
 
eigenvalue
eigenvalueeigenvalue
eigenvalue
Asyraf Ghani
 
Eigenvalue eigenvector slides
Eigenvalue eigenvector slidesEigenvalue eigenvector slides
Eigenvalue eigenvector slides
AmanSaeed11
 
MODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptxMODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptx
AlokSingh205089
 
Linear_Algebra_final.pdf
Linear_Algebra_final.pdfLinear_Algebra_final.pdf
Linear_Algebra_final.pdf
RohitAnand125
 

Similar to 4. Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization (20)

Eigen values and Eigen vectors ppt world
Eigen values and Eigen vectors ppt worldEigen values and Eigen vectors ppt world
Eigen values and Eigen vectors ppt world
 
Sec 3.4 Eigen values and Eigen vectors.pptx
Sec 3.4 Eigen values and Eigen vectors.pptxSec 3.4 Eigen values and Eigen vectors.pptx
Sec 3.4 Eigen values and Eigen vectors.pptx
 
Matlab eig
Matlab eigMatlab eig
Matlab eig
 
5. Linear Algebra for Machine Learning: Singular Value Decomposition and Prin...
5. Linear Algebra for Machine Learning: Singular Value Decomposition and Prin...5. Linear Algebra for Machine Learning: Singular Value Decomposition and Prin...
5. Linear Algebra for Machine Learning: Singular Value Decomposition and Prin...
 
Matrices ppt
Matrices pptMatrices ppt
Matrices ppt
 
Module 1 Theory of Matrices.pdf
Module 1 Theory of Matrices.pdfModule 1 Theory of Matrices.pdf
Module 1 Theory of Matrices.pdf
 
PROJECT
PROJECTPROJECT
PROJECT
 
Spectral Clustering Report
Spectral Clustering ReportSpectral Clustering Report
Spectral Clustering Report
 
Eigen-Decomposition: Eigenvalues and Eigenvectors.pdf
Eigen-Decomposition: Eigenvalues and Eigenvectors.pdfEigen-Decomposition: Eigenvalues and Eigenvectors.pdf
Eigen-Decomposition: Eigenvalues and Eigenvectors.pdf
 
Tutorial on EM algorithm – Part 1
Tutorial on EM algorithm – Part 1Tutorial on EM algorithm – Part 1
Tutorial on EM algorithm – Part 1
 
Eigen values and eigen vectors engineering
Eigen values and eigen vectors engineeringEigen values and eigen vectors engineering
Eigen values and eigen vectors engineering
 
Power method
Power methodPower method
Power method
 
Deep learning book_chap_02
Deep learning book_chap_02Deep learning book_chap_02
Deep learning book_chap_02
 
DOC-20231230-WA0001..pdf
DOC-20231230-WA0001..pdfDOC-20231230-WA0001..pdf
DOC-20231230-WA0001..pdf
 
project report(1)
project report(1)project report(1)
project report(1)
 
Numerical solution of eigenvalues and applications 2
Numerical solution of eigenvalues and applications 2Numerical solution of eigenvalues and applications 2
Numerical solution of eigenvalues and applications 2
 
eigenvalue
eigenvalueeigenvalue
eigenvalue
 
Eigenvalue eigenvector slides
Eigenvalue eigenvector slidesEigenvalue eigenvector slides
Eigenvalue eigenvector slides
 
MODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptxMODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptx
 
Linear_Algebra_final.pdf
Linear_Algebra_final.pdfLinear_Algebra_final.pdf
Linear_Algebra_final.pdf
 

Recently uploaded

Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 

Recently uploaded (20)

Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 

4. Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization

  • 1. Seminar Series on Linear Algebra for Machine Learning Part 4: Eigenvalues, Eigenvectors and Diagonalization Dr. Ceni Babaoglu Data Science Laboratory Ryerson University cenibabaoglu.com Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 2. Overview 1 Eigenvalues and eigenvectors 2 Some properties of eigenvalues and eigenvectors 3 Similar matrices 4 Diagonalizable matrices 5 Some properties of diagonalizable matrices 6 References Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 3. Eigenvalues and Eigenvectors When a matrix multiplies a vector in general the magnitude and direction of the vector will change. There are special vectors where only their magnitude is changed when multiplied by a matrix. These special vectors are called eigenvectors. The value by which the length changes is the associated eigenvalue. We say that x is an eigenvector of A if Ax = λx. λ is called the associated eigenvalue. Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 4. Eigenvalues and Eigenvectors The matrix A transforms 5 different vectors to other 5 different vectors. Vector (1) is transformed to vector (a), vector (2) is transformed to vector (b) and so on. Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 5. Eigenvalues and Eigenvectors All the vectors except vector (4) change both their magnitude and direction when transformed by A. Vector (4) changes only magnitude and does not change direction. Vector (4) is an eigenvector of A. λ = Magnitude of vector (d) Magnitude of vector (4) Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 6. Eigenvalues and Eigenvectors In this mapping the red arrow changes direction but the blue arrow does not. The blue arrow is an eigenvector of this mapping because it does not change direction, and since its length is unchanged, its eigenvalue is 1. Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 7. Some properties If λ1, λ2, · · · , λn are distinct eigenvalues of a matrix, then the corresponding eigenvectors e1, e2, · · · , en are linearly independent. If e1 is an eigenvector of a matrix with corresponding eigenvalue λ1, then any nonzero scalar multiple of e1 is also an eigenvector with eigenvalue λ1. A real, symmetric square matrix has real eigenvalues, with orthogonal eigenvectors (can be chosen to be orthonormal). Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 8. Some properties The equation Ax = λx can be written in the form (A − λI)x = 0 (1) λ is an eigenvalue of A if and only if (1) has a nontrivial solution. (1) has nontrivial solution if and only if A − λI is singular, or equivalently det(A − λI) = 0 → characteristic equation for A (2) If (2) is expanded, we obtain an nth degree polynomial in λ, p(λ) = det(A − λI) → characteristic polynomial Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 9. Similar Matrices A matrix B is said to be similar to a matrix A if there exists a nonsingular matrix S such that B = S−1 AS. For n × n matrices A and B, if A is similar to B, then the two matrices both have the same characteristic polynomial and, consequently, both have the same eigenvalues. Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 10. Diagonalizable Matrices An n × n matrix A is said to be diagonalizable if there exists a nonsingular matrix X and a diagonal matrix D such that X−1 AX = D. We say that X diagonalizes A. Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 11. Some Properties An n × n matrix A is diagonalizable if and only if A has n linearly independent eigenvectors. If A is diagonalizable, then the column vectors of the diagonalizing matrix X are eigenvectors of A and the diagonal elements of D are the corresponding eigenvalues of A. The diagonalizing matrix X is not unique. Reordering the columns of a given diagonalizing matrix X or multiplying them by nonzero scalars will produce a new diagonalizing matrix. Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 12. Some Properties If an n × n matrix A has n distinct eigenvalues, then A is diagonalizable. If the eigenvalues are not distinct, then A may or may not be diagonalizable, depending on whether A has n linearly independent eigenvectors. If A is diagonalizable, then A can be factored into a product XDX−1 . Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 13. Some Properties All the roots of the characteristic polynomial of a symmetric matrix are real numbers. If A is a symmetric matrix, then eigenvectors that belong to distinct eigenvalues of A are orthogonal. Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 14. Example Diagonalize the matrix A =   2 −2 3 1 1 1 1 3 −1   We should solve the equation |A − λI| = 0. |A − λI| = 2 − λ −2 3 1 1 − λ 1 1 3 −1 − λ R2−R3→R2 −−−−−−−→ 2 − λ −2 3 0 −2 − λ 2 + λ 1 3 −1 − λ = (2 + λ) 2 − λ −2 3 0 −1 1 1 3 −1 − λ C2+C3→C2 −−−−−−−→ (2 + λ) 2 − λ 1 3 0 0 1 1 2 − λ −1 − λ = −(2 + λ) 2 − λ 1 1 2 − λ = −(2 + λ)[(2 − λ)2 − 1] = −(2 + λ)(λ2 − 4λ + 3) = 0. Eigenvalues: λ1 = 1, λ2 = 3, λ3 = −2. Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 15. Example A =   2 −2 3 1 1 1 1 3 −1   We solve the equation |A − λI| = 0. Eigenvalues: λ1 = 1, λ2 = 3, λ3 = −2. The 3 × 3 matrix A has 3 distinct real eigenvalues. It has 3 linearly independent eigenvectors which implies A is diagonalizable. Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 16. Example To find the eigenvector corresponding to λ1 = 1, we solve the homogeneous system (A − λ1I) u = 0. (A − I) u = 0 ⇒   1 −2 3 1 0 1 1 3 −2   ·   u1 u2 u3   = 0 ⇒   1 −2 3 1 0 1 1 3 −2   R2−R1→R2 R3−R1→R3 −−−−−−−→   1 −2 3 0 2 −2 0 5 −5   R2/2→R2 R3/5→R3 −−−−−→   1 −2 3 0 1 −1 0 1 −1   R1+2R2→R1 R3−R2→R3 −−−−−−−→   1 0 1 0 1 −1 0 0 0   ⇒ u1 + u3 = 0 u2 − u3 = 0 ⇒ u1 = −u2 = −u3 = α An eigenvector corresponding to λ1 = 1 is   −1 1 1   Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 17. Example To find the eigenvector corresponding to λ2 = 3, we solve the homogeneous system (A − λ2I) v = 0. ⇒ (A − 3I) v = 0 ⇒   −1 −2 3 1 −2 1 1 3 −4   ·   v1 v2 v3   = 0 ⇒   −1 −2 3 1 −2 1 1 3 −4   R2+R1→R2 R3+R1→R3 −−−−−−−→   −1 −2 3 0 −4 4 0 1 −1   −R1→R1 −R2/4→R2 −−−−−−−→   1 2 −3 0 1 −1 0 1 −1   R1−2R2→R1 R3−R2→R3 −−−−−−−→   1 0 −1 0 1 −1 0 0 0   ⇒ v1 − v3 = 0 v2 − v3 = 0 ⇒ v1 = v2 = v3 = α An eigenvector corresponding to λ2 = 3 is   1 1 1   Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 18. Example To find the eigenspace corresponding to λ3 = −2, we solve the homogeneous system (A − λ3I) w = 0. ⇒ (A + 2I) w = 0 ⇒   4 −2 3 1 3 1 1 3 1   ·   w1 w2 w3   = 0 ⇒   4 −2 3 1 3 1 1 3 1   R1−4R2→R1 R3−R2→R3 −−−−−−−→   0 −14 −1 1 3 1 0 0 0   R1↔R2 −−−−→   1 3 1 0 −14 −1 0 0 0   −R2/14→R2 −−−−−−−→   1 3 1 0 1 1/14 0 0 0   R1−3R2→R1 −−−−−−−→   1 0 11/14 0 1 1/14 0 0 0   ⇒ w1 + 11w3/14 = 0 w2 + w3/14 = 0 ⇒ w1 = 11α w2 = α w3 = −14α An eigenvector corresponding to λ3 = −2 is   11 1 −14   Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 19. Example X−1 AX = D   −1/2 5/6 −1/3 1/2 1/10 2/5 0 1/15 −1/15     2 −2 3 1 1 1 1 3 −1     −1 1 11 1 1 1 1 1 −14   =   1 0 0 0 3 0 0 0 −2   A = XDX−1   2 −2 3 1 1 1 1 3 −1   =   −1 1 11 1 1 1 1 1 −14     1 0 0 0 3 0 0 0 −2     −1/2 5/6 −1/3 1/2 1/10 2/5 0 1/15 −1/15   Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization
  • 20. References Linear Algebra With Applications, 7th Edition by Steven J. Leon. Elementary Linear Algebra with Applications, 9th Edition by Bernard Kolman and David Hill. http://www.sharetechnote.com/html/Handbook_EngMath_Matrix_ Eigen.html https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors Dr. Ceni Babaoglu cenibabaoglu.com Linear Algebra for Machine Learning: Eigenvalues, Eigenvectors and Diagonalization