SlideShare a Scribd company logo
PCA
Data science and AI Certification Course
Visit: Learnbay.co
Introduction
1. What is Standard Deviation?
2. What is Variance ?
The last two measures we have looked at are purely 1-dimensional.
However many datasets have more than one dimension, the aim of the statistical
analysis is to see if there is any relationship between these dimensions.
For example, we might have as our data set both the height of all the students in a
class, and the mark they received for that paper. We could then perform statistical
analysis to see if the height of a student has any effect on their mark.
Visit: Learnbay.co
It is useful to have a measure to find out how much the dimensions vary from the
mean with respect to each other.
Covariance is such a measure. Covariance is always measured between 2
dimensions. If you calculate the covariance between one dimension and itself, you
get the variance
So, if you have a 3-dimensional data (x, y, z) then covariance will be calculated
Between x, y and y,z and z,x and x,x and y,y and z,z
Visit: Learnbay.co
Covariance result
● Positive
● Negative
● Zero
Is Cov(x,y) same as Cov(y,x)?
What is Covariance Matrix?
For a 3-Dimensional dataset, we can calculate Covariance etween x, y and y,zand
z,x
Visit: Learnbay.co
Covariance Matrix for 3-D
Visit: Learnbay.co
Matrix Terminology
Visit: Learnbay.co
Eigenvalues and EigenVectors
A v = λ v
Visit: Learnbay.co
Eigenvectors
As you know, two matrices can be multiplied if they are compatible. Eigen vectors
are special case. When you multiply with Eigenvectors, the resulting vector will be
a scalar multiplication ofthat vector.
What does this signify ?
Let us look atan example
Visit: Learnbay.co
The vector is a vector in 2 dimensional space. The vector (3 2 )T
(from the second example multiplication) represents an arrow pointing
from the origin (0,0) to (3 2)
The other matrix, the square one, can be thought of as a transformation matrix. If
you multiply this matrix on the left of a vector, the answer is another vector that is
transformed from it’s original position.
Visit: Learnbay.co
Eigenvectors Example
Visit: Learnbay.co
Visit: Learnbay.co
Visit: Learnbay.co
Demonstration
https://upload.wikimedia.org/wikipedia/commons/0/06/Eigenvectors.gif
https://upload.wikimedia.org/wikipedia/commons/a/ad/Eigenvectors-extended.gi
f
Visit: Learnbay.co
Few properties of Eigenvectors
● Given a 3x3 matrix, there are 3 eigenvectors
● Another property of eigenvectors is that even if I scale the vector by some
amount before I multiply it, I still get the same multiple of it as a result, as in
Figure 2.3. This is because if you scale a vector by some amount, all you are
doing is making it longer
● All Eigenvectors of a matrix are orthogonal. This is important because, we can
express the data instead of x,y axes
Visit: Learnbay.co
● Another important thing to know is that when mathematicians find
eigenvectors, they like to find the eigenvectors whose length is exactly one.
This is because, as you know, the length of a vector doesn’t affect whether it’s
an eigenvector or not, whereas the direction does. So, in order to keep
eigenvectors standard, whenever we find an eigenvector we usually scale it to
make it have a length of 1, so that all eigenvectors have the same length
For example,
Visit: Learnbay.co
Eigenvalues
Eigenvalues are closely related to Eigenvectors. Eigenvalue was 4 in our earlier
example. Notice even if v is scaled the eigenvalue still remains 4.
Visit: Learnbay.co
PCA …finally!
It is a way of identifying patterns in data, and expressing the data in such a way
as to highlight their similarities and differences.
The other main advantage of PCA is that once you have found these patterns in
the data, and you compress the data, ie. by reducing the number of dimensions,
without much loss of information.
Visit: Learnbay.co
Step: 1 Get data
Visit: Learnbay.co
Step: 2 Subtract mean
From all the points subtract the mean for PCAto work properly
Visit: Learnbay.co
Step: 3 Covariance Matrix
Visit: Learnbay.co
Step: 4
Calculate the Eigenvectors andEigenvalues for the Covariance Matrix
Visit: Learnbay.co
It is important to notice that these eigenvectors are both unit eigenvectors ie. their
lengths are both 1
If you look at the plot of the data in Figure 3.2 then you can see how the data has
quite a strong pattern. As expected from the covariance matrix, they two variables
do indeed increase together
Visit: Learnbay.co
What information does Eigenvectorsgive?
See how one of the eigenvectors goes through the middle of the points, like
drawing a line of best fit? That eigenvector is showing us how these two data sets
are related along that line. The second eigenvector gives us the other, less
important, pattern in the data, that all the points follow the main line, but are off to
the side of the main line by some amount.
Visit: Learnbay.co
Visit: Learnbay.co
Choosing the components
It turns out that the eigenvector with the highest eigenvalue is the principle
component of the data set. In our example, the eigenvector with the largest
eigenvalue was the one that pointed down the middle of the data. It is the most
significant relationship between the data dimensions
once eigenvectors are found from the covariance matrix, the next step is to order
them by eigenvalue, highest to lowest. This gives you the components in order of
significance.
Visit: Learnbay.co
Now, if you like, you can decide to ignore the components of lesser significance.
You do lose some information, but if the eigenvalues are small, you don’t lose
much. If you leave out some components, the final data set will have less
dimensions than the original.
Visit: Learnbay.co
Visit: Learnbay.co
References
http://www.iro.umontreal.ca/~pift6080/H09/documents/papers/pca_tutorial.pdf
https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors
Visit: Learnbay.co

More Related Content

What's hot

Implement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratchImplement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratch
EshanAgarwal4
 
Lect5 principal component analysis
Lect5 principal component analysisLect5 principal component analysis
Lect5 principal component analysis
hktripathy
 
Statistics for data science
Statistics for data science Statistics for data science
Statistics for data science
zekeLabs Technologies
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
YashwantGahlot1
 
Principal component analysis and lda
Principal component analysis and ldaPrincipal component analysis and lda
Principal component analysis and lda
Suresh Pokharel
 
Exploratory data analysis with Python
Exploratory data analysis with PythonExploratory data analysis with Python
Exploratory data analysis with Python
Davis David
 
Principal Component Analysis and Clustering
Principal Component Analysis and ClusteringPrincipal Component Analysis and Clustering
Principal Component Analysis and Clustering
Usha Vijay
 
Lect4 principal component analysis-I
Lect4 principal component analysis-ILect4 principal component analysis-I
Lect4 principal component analysis-I
hktripathy
 
Logistic regression
Logistic regressionLogistic regression
Logistic regressionsaba khan
 
Hierarchical Clustering
Hierarchical ClusteringHierarchical Clustering
Hierarchical Clustering
Carlos Castillo (ChaTo)
 
Principal component analysis
Principal component analysisPrincipal component analysis
Principal component analysis
Partha Sarathi Kar
 
Bayesian networks
Bayesian networksBayesian networks
Bayesian networks
Massimiliano Patacchiola
 
Data Reduction
Data ReductionData Reduction
Data Reduction
Rajan Shah
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
kishanthkumaar
 
Ridge regression
Ridge regressionRidge regression
Ridge regression
Ananda Swarup
 
Exploratory data analysis
Exploratory data analysisExploratory data analysis
Exploratory data analysis
gokulprasath06
 
NAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIERNAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIER
Knoldus Inc.
 

What's hot (20)

Implement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratchImplement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratch
 
Lect5 principal component analysis
Lect5 principal component analysisLect5 principal component analysis
Lect5 principal component analysis
 
Statistics for data science
Statistics for data science Statistics for data science
Statistics for data science
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Principal component analysis and lda
Principal component analysis and ldaPrincipal component analysis and lda
Principal component analysis and lda
 
Exploratory data analysis with Python
Exploratory data analysis with PythonExploratory data analysis with Python
Exploratory data analysis with Python
 
PCA
PCAPCA
PCA
 
Principal Component Analysis and Clustering
Principal Component Analysis and ClusteringPrincipal Component Analysis and Clustering
Principal Component Analysis and Clustering
 
Lect4 principal component analysis-I
Lect4 principal component analysis-ILect4 principal component analysis-I
Lect4 principal component analysis-I
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Hierarchical Clustering
Hierarchical ClusteringHierarchical Clustering
Hierarchical Clustering
 
Principal component analysis
Principal component analysisPrincipal component analysis
Principal component analysis
 
Classification metrics
Classification metrics Classification metrics
Classification metrics
 
Bayesian networks
Bayesian networksBayesian networks
Bayesian networks
 
Data Reduction
Data ReductionData Reduction
Data Reduction
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
 
Ridge regression
Ridge regressionRidge regression
Ridge regression
 
Exploratory data analysis
Exploratory data analysisExploratory data analysis
Exploratory data analysis
 
NAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIERNAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIER
 

Similar to PCA (Principal component analysis)

Machine learning session8(svm nlp)
Machine learning   session8(svm nlp)Machine learning   session8(svm nlp)
Machine learning session8(svm nlp)
Abhimanyu Dwivedi
 
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptxKNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
Nishant83346
 
Vector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operationsVector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operations
ssuser2624f71
 
Data Science and Machine learning-Lect01.pdf
Data Science and Machine learning-Lect01.pdfData Science and Machine learning-Lect01.pdf
Data Science and Machine learning-Lect01.pdf
RAJVEERKUMAR41
 
LO 1.1. USE PHYSICAL QUANTITIES.pdf
LO 1.1. USE PHYSICAL QUANTITIES.pdfLO 1.1. USE PHYSICAL QUANTITIES.pdf
LO 1.1. USE PHYSICAL QUANTITIES.pdf
HabyarimanaProjecte
 
Ir 08
Ir   08Ir   08
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
AmAn Singh
 
[Emnlp] what is glo ve part i - towards data science
[Emnlp] what is glo ve  part i - towards data science[Emnlp] what is glo ve  part i - towards data science
[Emnlp] what is glo ve part i - towards data science
Nikhil Jaiswal
 
Linear logisticregression
Linear logisticregressionLinear logisticregression
Linear logisticregression
kongara
 
Vectors Preparation Tips for IIT JEE | askIITians
Vectors Preparation Tips for IIT JEE | askIITiansVectors Preparation Tips for IIT JEE | askIITians
Vectors Preparation Tips for IIT JEE | askIITians
askiitian
 
[Emnlp] what is glo ve part iii - towards data science
[Emnlp] what is glo ve  part iii - towards data science[Emnlp] what is glo ve  part iii - towards data science
[Emnlp] what is glo ve part iii - towards data science
Nikhil Jaiswal
 
Introduction to Support Vector Machines
Introduction to Support Vector MachinesIntroduction to Support Vector Machines
Introduction to Support Vector Machines
Anish M M
 
Basics of Measurements.pdf
Basics of Measurements.pdfBasics of Measurements.pdf
Basics of Measurements.pdf
MOAZZAMALISATTI
 
Basics of Measurements.pdf
Basics of Measurements.pdfBasics of Measurements.pdf
Basics of Measurements.pdf
MOAZZAMALISATTI
 
Bootcamp of new world to taken seriously
Bootcamp of new world to taken seriouslyBootcamp of new world to taken seriously
Bootcamp of new world to taken seriously
khaled125087
 
Singular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptxSingular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptx
rajalakshmi5921
 
EDAB Module 5 Singular Value Decomposition (SVD).pptx
EDAB Module 5 Singular Value Decomposition (SVD).pptxEDAB Module 5 Singular Value Decomposition (SVD).pptx
EDAB Module 5 Singular Value Decomposition (SVD).pptx
rajalakshmi5921
 

Similar to PCA (Principal component analysis) (20)

Machine learning session8(svm nlp)
Machine learning   session8(svm nlp)Machine learning   session8(svm nlp)
Machine learning session8(svm nlp)
 
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptxKNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
KNN CLASSIFIER, INTRODUCTION TO K-NEAREST NEIGHBOR ALGORITHM.pptx
 
Vector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operationsVector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operations
 
Data analysis05 clustering
Data analysis05 clusteringData analysis05 clustering
Data analysis05 clustering
 
Data Science and Machine learning-Lect01.pdf
Data Science and Machine learning-Lect01.pdfData Science and Machine learning-Lect01.pdf
Data Science and Machine learning-Lect01.pdf
 
LO 1.1. USE PHYSICAL QUANTITIES.pdf
LO 1.1. USE PHYSICAL QUANTITIES.pdfLO 1.1. USE PHYSICAL QUANTITIES.pdf
LO 1.1. USE PHYSICAL QUANTITIES.pdf
 
Ir 08
Ir   08Ir   08
Ir 08
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
 
Covariance.pdf
Covariance.pdfCovariance.pdf
Covariance.pdf
 
[PPT]
[PPT][PPT]
[PPT]
 
[Emnlp] what is glo ve part i - towards data science
[Emnlp] what is glo ve  part i - towards data science[Emnlp] what is glo ve  part i - towards data science
[Emnlp] what is glo ve part i - towards data science
 
Linear logisticregression
Linear logisticregressionLinear logisticregression
Linear logisticregression
 
Vectors Preparation Tips for IIT JEE | askIITians
Vectors Preparation Tips for IIT JEE | askIITiansVectors Preparation Tips for IIT JEE | askIITians
Vectors Preparation Tips for IIT JEE | askIITians
 
[Emnlp] what is glo ve part iii - towards data science
[Emnlp] what is glo ve  part iii - towards data science[Emnlp] what is glo ve  part iii - towards data science
[Emnlp] what is glo ve part iii - towards data science
 
Introduction to Support Vector Machines
Introduction to Support Vector MachinesIntroduction to Support Vector Machines
Introduction to Support Vector Machines
 
Basics of Measurements.pdf
Basics of Measurements.pdfBasics of Measurements.pdf
Basics of Measurements.pdf
 
Basics of Measurements.pdf
Basics of Measurements.pdfBasics of Measurements.pdf
Basics of Measurements.pdf
 
Bootcamp of new world to taken seriously
Bootcamp of new world to taken seriouslyBootcamp of new world to taken seriously
Bootcamp of new world to taken seriously
 
Singular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptxSingular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptx
 
EDAB Module 5 Singular Value Decomposition (SVD).pptx
EDAB Module 5 Singular Value Decomposition (SVD).pptxEDAB Module 5 Singular Value Decomposition (SVD).pptx
EDAB Module 5 Singular Value Decomposition (SVD).pptx
 

More from Learnbay Datascience

Top data science projects
Top data science projectsTop data science projects
Top data science projects
Learnbay Datascience
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
Learnbay Datascience
 
Python my SQL - create database
Python my SQL - create databasePython my SQL - create database
Python my SQL - create database
Learnbay Datascience
 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
Learnbay Datascience
 
Python - mySOL
Python - mySOLPython - mySOL
Python - mySOL
Learnbay Datascience
 
AI - Issues and Terminology
AI - Issues and TerminologyAI - Issues and Terminology
AI - Issues and Terminology
Learnbay Datascience
 
AI - Fuzzy Logic Systems
AI - Fuzzy Logic SystemsAI - Fuzzy Logic Systems
AI - Fuzzy Logic Systems
Learnbay Datascience
 
AI - working of an ns
AI - working of an nsAI - working of an ns
AI - working of an ns
Learnbay Datascience
 
Artificial Intelligence- Neural Networks
Artificial Intelligence- Neural NetworksArtificial Intelligence- Neural Networks
Artificial Intelligence- Neural Networks
Learnbay Datascience
 
AI - Robotics
AI - RoboticsAI - Robotics
AI - Robotics
Learnbay Datascience
 
Applications of expert system
Applications of expert systemApplications of expert system
Applications of expert system
Learnbay Datascience
 
Components of expert systems
Components of expert systemsComponents of expert systems
Components of expert systems
Learnbay Datascience
 
Artificial intelligence - expert systems
 Artificial intelligence - expert systems Artificial intelligence - expert systems
Artificial intelligence - expert systems
Learnbay Datascience
 
AI - natural language processing
AI - natural language processingAI - natural language processing
AI - natural language processing
Learnbay Datascience
 
Ai popular search algorithms
Ai   popular search algorithmsAi   popular search algorithms
Ai popular search algorithms
Learnbay Datascience
 
AI - Agents & Environments
AI - Agents & EnvironmentsAI - Agents & Environments
AI - Agents & Environments
Learnbay Datascience
 
Artificial intelligence - research areas
Artificial intelligence - research areasArtificial intelligence - research areas
Artificial intelligence - research areas
Learnbay Datascience
 
Artificial intelligence composed
Artificial intelligence composedArtificial intelligence composed
Artificial intelligence composed
Learnbay Datascience
 
Artificial intelligence intelligent systems
Artificial intelligence   intelligent systemsArtificial intelligence   intelligent systems
Artificial intelligence intelligent systems
Learnbay Datascience
 
Applications of ai
Applications of aiApplications of ai
Applications of ai
Learnbay Datascience
 

More from Learnbay Datascience (20)

Top data science projects
Top data science projectsTop data science projects
Top data science projects
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
 
Python my SQL - create database
Python my SQL - create databasePython my SQL - create database
Python my SQL - create database
 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
 
Python - mySOL
Python - mySOLPython - mySOL
Python - mySOL
 
AI - Issues and Terminology
AI - Issues and TerminologyAI - Issues and Terminology
AI - Issues and Terminology
 
AI - Fuzzy Logic Systems
AI - Fuzzy Logic SystemsAI - Fuzzy Logic Systems
AI - Fuzzy Logic Systems
 
AI - working of an ns
AI - working of an nsAI - working of an ns
AI - working of an ns
 
Artificial Intelligence- Neural Networks
Artificial Intelligence- Neural NetworksArtificial Intelligence- Neural Networks
Artificial Intelligence- Neural Networks
 
AI - Robotics
AI - RoboticsAI - Robotics
AI - Robotics
 
Applications of expert system
Applications of expert systemApplications of expert system
Applications of expert system
 
Components of expert systems
Components of expert systemsComponents of expert systems
Components of expert systems
 
Artificial intelligence - expert systems
 Artificial intelligence - expert systems Artificial intelligence - expert systems
Artificial intelligence - expert systems
 
AI - natural language processing
AI - natural language processingAI - natural language processing
AI - natural language processing
 
Ai popular search algorithms
Ai   popular search algorithmsAi   popular search algorithms
Ai popular search algorithms
 
AI - Agents & Environments
AI - Agents & EnvironmentsAI - Agents & Environments
AI - Agents & Environments
 
Artificial intelligence - research areas
Artificial intelligence - research areasArtificial intelligence - research areas
Artificial intelligence - research areas
 
Artificial intelligence composed
Artificial intelligence composedArtificial intelligence composed
Artificial intelligence composed
 
Artificial intelligence intelligent systems
Artificial intelligence   intelligent systemsArtificial intelligence   intelligent systems
Artificial intelligence intelligent systems
 
Applications of ai
Applications of aiApplications of ai
Applications of ai
 

Recently uploaded

Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
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.
 
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
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
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
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
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
 
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
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 

Recently uploaded (20)

Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
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
 
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
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
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
 
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
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 

PCA (Principal component analysis)

  • 1. PCA Data science and AI Certification Course Visit: Learnbay.co
  • 2. Introduction 1. What is Standard Deviation? 2. What is Variance ? The last two measures we have looked at are purely 1-dimensional. However many datasets have more than one dimension, the aim of the statistical analysis is to see if there is any relationship between these dimensions. For example, we might have as our data set both the height of all the students in a class, and the mark they received for that paper. We could then perform statistical analysis to see if the height of a student has any effect on their mark. Visit: Learnbay.co
  • 3. It is useful to have a measure to find out how much the dimensions vary from the mean with respect to each other. Covariance is such a measure. Covariance is always measured between 2 dimensions. If you calculate the covariance between one dimension and itself, you get the variance So, if you have a 3-dimensional data (x, y, z) then covariance will be calculated Between x, y and y,z and z,x and x,x and y,y and z,z Visit: Learnbay.co
  • 4. Covariance result ● Positive ● Negative ● Zero Is Cov(x,y) same as Cov(y,x)? What is Covariance Matrix? For a 3-Dimensional dataset, we can calculate Covariance etween x, y and y,zand z,x Visit: Learnbay.co
  • 5. Covariance Matrix for 3-D Visit: Learnbay.co
  • 7. Eigenvalues and EigenVectors A v = λ v Visit: Learnbay.co
  • 8. Eigenvectors As you know, two matrices can be multiplied if they are compatible. Eigen vectors are special case. When you multiply with Eigenvectors, the resulting vector will be a scalar multiplication ofthat vector. What does this signify ? Let us look atan example Visit: Learnbay.co
  • 9. The vector is a vector in 2 dimensional space. The vector (3 2 )T (from the second example multiplication) represents an arrow pointing from the origin (0,0) to (3 2) The other matrix, the square one, can be thought of as a transformation matrix. If you multiply this matrix on the left of a vector, the answer is another vector that is transformed from it’s original position. Visit: Learnbay.co
  • 14. Few properties of Eigenvectors ● Given a 3x3 matrix, there are 3 eigenvectors ● Another property of eigenvectors is that even if I scale the vector by some amount before I multiply it, I still get the same multiple of it as a result, as in Figure 2.3. This is because if you scale a vector by some amount, all you are doing is making it longer ● All Eigenvectors of a matrix are orthogonal. This is important because, we can express the data instead of x,y axes Visit: Learnbay.co
  • 15. ● Another important thing to know is that when mathematicians find eigenvectors, they like to find the eigenvectors whose length is exactly one. This is because, as you know, the length of a vector doesn’t affect whether it’s an eigenvector or not, whereas the direction does. So, in order to keep eigenvectors standard, whenever we find an eigenvector we usually scale it to make it have a length of 1, so that all eigenvectors have the same length For example, Visit: Learnbay.co
  • 16. Eigenvalues Eigenvalues are closely related to Eigenvectors. Eigenvalue was 4 in our earlier example. Notice even if v is scaled the eigenvalue still remains 4. Visit: Learnbay.co
  • 17. PCA …finally! It is a way of identifying patterns in data, and expressing the data in such a way as to highlight their similarities and differences. The other main advantage of PCA is that once you have found these patterns in the data, and you compress the data, ie. by reducing the number of dimensions, without much loss of information. Visit: Learnbay.co
  • 18. Step: 1 Get data Visit: Learnbay.co
  • 19. Step: 2 Subtract mean From all the points subtract the mean for PCAto work properly Visit: Learnbay.co
  • 20. Step: 3 Covariance Matrix Visit: Learnbay.co
  • 21. Step: 4 Calculate the Eigenvectors andEigenvalues for the Covariance Matrix Visit: Learnbay.co
  • 22. It is important to notice that these eigenvectors are both unit eigenvectors ie. their lengths are both 1 If you look at the plot of the data in Figure 3.2 then you can see how the data has quite a strong pattern. As expected from the covariance matrix, they two variables do indeed increase together Visit: Learnbay.co
  • 23. What information does Eigenvectorsgive? See how one of the eigenvectors goes through the middle of the points, like drawing a line of best fit? That eigenvector is showing us how these two data sets are related along that line. The second eigenvector gives us the other, less important, pattern in the data, that all the points follow the main line, but are off to the side of the main line by some amount. Visit: Learnbay.co
  • 25. Choosing the components It turns out that the eigenvector with the highest eigenvalue is the principle component of the data set. In our example, the eigenvector with the largest eigenvalue was the one that pointed down the middle of the data. It is the most significant relationship between the data dimensions once eigenvectors are found from the covariance matrix, the next step is to order them by eigenvalue, highest to lowest. This gives you the components in order of significance. Visit: Learnbay.co
  • 26. Now, if you like, you can decide to ignore the components of lesser significance. You do lose some information, but if the eigenvalues are small, you don’t lose much. If you leave out some components, the final data set will have less dimensions than the original. Visit: Learnbay.co