SlideShare a Scribd company logo
A principled way to principal
components analysis
Teaching activity objectives
• Visualize large data sets.
• Transform the data to aid in this
visualization.
• Clustering data.
• Implement basic linear algebra operations.
• Connect this operations to neuronal
models and brain function.
Context for the activity
• Homework Assignment in 9.40 Intro to
neural Computation (Sophomore/Junior).
• In-class activity 9.014 Quantitative
Methods and Computational Models in
Neuroscience (1st year PhD).
Data visualization and
performing pca:
MNIST data set
28 by 28 pixels
8-bit gray scale images
These images live in
a 784 dimensional space
http://yann.lecun.com/exdb/mnist/
Can we cluster images in the
pixel space?
One possible visualization
There are more than 300000 possible pairwise pixel plots!!!
Is there a more principled way?
• Represent the data in a new basis set.
• Aids in visualization and potentially in
clustering and dimensionality reduction.
• PCA provides such a basis set by looking
at directions that capture most variance.
• The directions are ranked by decreasing
variance.
• It diagonalizes the covariance matrix.
Pedagogical approach
• Guide them step by step to implement PCA.
• Emphasize visualizations and geometrical
approach/intuition.
• We don’t use the MATLAB canned function
for PCA.
• We want students to get their hands “dirty”.
This helps build confidence and deep
understanding.
PCA Mantra
• Reshape the data to proper format for PCA.
• Center the data performing mean subtraction.
• Construct the data covariance matrix.
• Perform SVD to obtain the eigenvalues and
eigenvectors of the covariance matrix.
• Compute the variance explained per component
and plot it.
• Reshape the eigenvectors and visualize their
images.
• Project the mean subtracted data onto the
eigenvectors basis.
First 9 Eigenvectors
Projections onto the first 2 axes
• The first two PCs capture ~37% of the variance.
• The data forms clear clusters that are almost linearly separable
Building models: Synapses and
PCA
• 1949 book: 'The Organization
of Behavior' Theory about the
neural bases of learning
• Learning takes place at
synapses.
• Synapses get modified, they
get stronger when the pre- and
post- synaptic cells fire
together.
• "Cells that fire together, wire
together"
Hebbian Learning
Donald Hebb
Unstable
Building Hebbian synapses
Erkki Oja
Oja’s rule
A simplified neuron model as a principal component analyzer. Journal of Mathematical Biology,
15:267-273 (1982).
Feedback,forgetting term or regularizer
• Stabilizes the Hebbian rule.
• Leads to a covariance learning rule: the weights
converge to the first eigenvector of the covariance
matrix.
• Similar to power iteration method.
Learning outcomes
• Visualize and manipulate a relatively large and
complex data set.
• Perform PCA by building it step by step.
• Gain an intuition of the geometry involved in a
change of basis and projections.
• Start thinking about basic clustering
algorithms.
• Discuss on dimensionality reduction and other
PCA applications
Learning outcomes (cont)
• Discuss the assumptions, limitations and
shortcomings of applying PCA in different
contexts.
• Build a model of how PCA might actually
take place in neural circuits.
• Follow up: eigenfaces, is the brain doing
PCA to recognize faces?

More Related Content

Viewers also liked

Jisc Analytics maturity and services
Jisc Analytics maturity and servicesJisc Analytics maturity and services
Jisc Analytics maturity and services
mwebbjisc
 
Collage de emociones.jpg
Collage de emociones.jpgCollage de emociones.jpg
Collage de emociones.jpg
gonzalezedwin9877
 
Cuento del medio ambiente LUGO WILNOR
Cuento del medio ambiente LUGO WILNORCuento del medio ambiente LUGO WILNOR
Cuento del medio ambiente LUGO WILNOR
william yajue
 
Ficha diagnóstica português 5ºano
Ficha diagnóstica português 5ºanoFicha diagnóstica português 5ºano
Ficha diagnóstica português 5ºano
Ana Raquel Moreira
 
Jesse James Jamnik: Fitness Tips - Building Muscle
Jesse James Jamnik: Fitness Tips - Building MuscleJesse James Jamnik: Fitness Tips - Building Muscle
Jesse James Jamnik: Fitness Tips - Building Muscle
Jesse James Jamnik
 
Webquestednapaula celiabatista iolandaxavier_meirefuzzaro
Webquestednapaula celiabatista iolandaxavier_meirefuzzaroWebquestednapaula celiabatista iolandaxavier_meirefuzzaro
Webquestednapaula celiabatista iolandaxavier_meirefuzzaroCelia Batista
 
Fitness tips for women
Fitness tips for womenFitness tips for women
Fitness tips for women
Medisys Kart
 
Hoja de vida juan camilo gomez
Hoja de vida juan camilo gomezHoja de vida juan camilo gomez
Hoja de vida juan camilo gomez
Juan Camilo Gomez Parra
 

Viewers also liked (10)

Jisc Analytics maturity and services
Jisc Analytics maturity and servicesJisc Analytics maturity and services
Jisc Analytics maturity and services
 
eStudy Company Brochure
eStudy Company BrochureeStudy Company Brochure
eStudy Company Brochure
 
MTSingle
MTSingleMTSingle
MTSingle
 
Collage de emociones.jpg
Collage de emociones.jpgCollage de emociones.jpg
Collage de emociones.jpg
 
Cuento del medio ambiente LUGO WILNOR
Cuento del medio ambiente LUGO WILNORCuento del medio ambiente LUGO WILNOR
Cuento del medio ambiente LUGO WILNOR
 
Ficha diagnóstica português 5ºano
Ficha diagnóstica português 5ºanoFicha diagnóstica português 5ºano
Ficha diagnóstica português 5ºano
 
Jesse James Jamnik: Fitness Tips - Building Muscle
Jesse James Jamnik: Fitness Tips - Building MuscleJesse James Jamnik: Fitness Tips - Building Muscle
Jesse James Jamnik: Fitness Tips - Building Muscle
 
Webquestednapaula celiabatista iolandaxavier_meirefuzzaro
Webquestednapaula celiabatista iolandaxavier_meirefuzzaroWebquestednapaula celiabatista iolandaxavier_meirefuzzaro
Webquestednapaula celiabatista iolandaxavier_meirefuzzaro
 
Fitness tips for women
Fitness tips for womenFitness tips for women
Fitness tips for women
 
Hoja de vida juan camilo gomez
Hoja de vida juan camilo gomezHoja de vida juan camilo gomez
Hoja de vida juan camilo gomez
 

Similar to A principled way to principal components analysis

Semester presentation
Semester presentationSemester presentation
Semester presentation
khush bakhat
 
Artificial Neural Network Learning Algorithm.ppt
Artificial Neural Network Learning Algorithm.pptArtificial Neural Network Learning Algorithm.ppt
Artificial Neural Network Learning Algorithm.ppt
NJUSTAiMo
 
From deep learning to deep reasoning
From deep learning to deep reasoningFrom deep learning to deep reasoning
From deep learning to deep reasoning
Deakin University
 
w1-01-introtonn.ppt
w1-01-introtonn.pptw1-01-introtonn.ppt
w1-01-introtonn.ppt
KotaGuru1
 
Computational Giants_nhom.pptx
Computational Giants_nhom.pptxComputational Giants_nhom.pptx
Computational Giants_nhom.pptx
ThAnhonc
 
Neural net and back propagation
Neural net and back propagationNeural net and back propagation
Neural net and back propagation
Mohit Shrivastava
 
Introduction to Hamiltonian Neural Networks
Introduction to Hamiltonian Neural NetworksIntroduction to Hamiltonian Neural Networks
Introduction to Hamiltonian Neural Networks
Miles Cranmer
 
NS-CUK Seminar: H.B.Kim, Review on "Sequential Recommendation with Graph Neu...
NS-CUK Seminar: H.B.Kim,  Review on "Sequential Recommendation with Graph Neu...NS-CUK Seminar: H.B.Kim,  Review on "Sequential Recommendation with Graph Neu...
NS-CUK Seminar: H.B.Kim, Review on "Sequential Recommendation with Graph Neu...
ssuser4b1f48
 
02 Fundamental Concepts of ANN
02 Fundamental Concepts of ANN02 Fundamental Concepts of ANN
02 Fundamental Concepts of ANN
Tamer Ahmed Farrag, PhD
 
Fundamentals of Neural Network (Soft Computing)
Fundamentals of Neural Network (Soft Computing)Fundamentals of Neural Network (Soft Computing)
Fundamentals of Neural Network (Soft Computing)
Amit Kumar Rathi
 
Fcv bio cv_cottrell
Fcv bio cv_cottrellFcv bio cv_cottrell
Fcv bio cv_cottrellzukun
 
Fcv bio cv_cottrell
Fcv bio cv_cottrellFcv bio cv_cottrell
Fcv bio cv_cottrellzukun
 
Understanding Deep Learning Requires Rethinking Generalization
Understanding Deep Learning Requires Rethinking GeneralizationUnderstanding Deep Learning Requires Rethinking Generalization
Understanding Deep Learning Requires Rethinking Generalization
Ahmet Kuzubaşlı
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
nainabhatt2
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
NainaBhatt1
 
Backpropagation and the brain review
Backpropagation and the brain reviewBackpropagation and the brain review
Backpropagation and the brain review
Seonghyun Kim
 
PR095: Modularity Matters: Learning Invariant Relational Reasoning Tasks
PR095: Modularity Matters: Learning Invariant Relational Reasoning TasksPR095: Modularity Matters: Learning Invariant Relational Reasoning Tasks
PR095: Modularity Matters: Learning Invariant Relational Reasoning Tasks
Jinwon Lee
 
Neural Networks for Machine Learning and Deep Learning
Neural Networks for Machine Learning and Deep LearningNeural Networks for Machine Learning and Deep Learning
Neural Networks for Machine Learning and Deep Learning
comifa7406
 
Introduction to Neural networks (under graduate course) Lecture 9 of 9
Introduction to Neural networks (under graduate course) Lecture 9 of 9Introduction to Neural networks (under graduate course) Lecture 9 of 9
Introduction to Neural networks (under graduate course) Lecture 9 of 9
Randa Elanwar
 

Similar to A principled way to principal components analysis (20)

Semester presentation
Semester presentationSemester presentation
Semester presentation
 
Artificial Neural Network Learning Algorithm.ppt
Artificial Neural Network Learning Algorithm.pptArtificial Neural Network Learning Algorithm.ppt
Artificial Neural Network Learning Algorithm.ppt
 
From deep learning to deep reasoning
From deep learning to deep reasoningFrom deep learning to deep reasoning
From deep learning to deep reasoning
 
w1-01-introtonn.ppt
w1-01-introtonn.pptw1-01-introtonn.ppt
w1-01-introtonn.ppt
 
Computational Giants_nhom.pptx
Computational Giants_nhom.pptxComputational Giants_nhom.pptx
Computational Giants_nhom.pptx
 
230727_HB_JointJournalClub.pptx
230727_HB_JointJournalClub.pptx230727_HB_JointJournalClub.pptx
230727_HB_JointJournalClub.pptx
 
Neural net and back propagation
Neural net and back propagationNeural net and back propagation
Neural net and back propagation
 
Introduction to Hamiltonian Neural Networks
Introduction to Hamiltonian Neural NetworksIntroduction to Hamiltonian Neural Networks
Introduction to Hamiltonian Neural Networks
 
NS-CUK Seminar: H.B.Kim, Review on "Sequential Recommendation with Graph Neu...
NS-CUK Seminar: H.B.Kim,  Review on "Sequential Recommendation with Graph Neu...NS-CUK Seminar: H.B.Kim,  Review on "Sequential Recommendation with Graph Neu...
NS-CUK Seminar: H.B.Kim, Review on "Sequential Recommendation with Graph Neu...
 
02 Fundamental Concepts of ANN
02 Fundamental Concepts of ANN02 Fundamental Concepts of ANN
02 Fundamental Concepts of ANN
 
Fundamentals of Neural Network (Soft Computing)
Fundamentals of Neural Network (Soft Computing)Fundamentals of Neural Network (Soft Computing)
Fundamentals of Neural Network (Soft Computing)
 
Fcv bio cv_cottrell
Fcv bio cv_cottrellFcv bio cv_cottrell
Fcv bio cv_cottrell
 
Fcv bio cv_cottrell
Fcv bio cv_cottrellFcv bio cv_cottrell
Fcv bio cv_cottrell
 
Understanding Deep Learning Requires Rethinking Generalization
Understanding Deep Learning Requires Rethinking GeneralizationUnderstanding Deep Learning Requires Rethinking Generalization
Understanding Deep Learning Requires Rethinking Generalization
 
Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
 
Backpropagation and the brain review
Backpropagation and the brain reviewBackpropagation and the brain review
Backpropagation and the brain review
 
PR095: Modularity Matters: Learning Invariant Relational Reasoning Tasks
PR095: Modularity Matters: Learning Invariant Relational Reasoning TasksPR095: Modularity Matters: Learning Invariant Relational Reasoning Tasks
PR095: Modularity Matters: Learning Invariant Relational Reasoning Tasks
 
Neural Networks for Machine Learning and Deep Learning
Neural Networks for Machine Learning and Deep LearningNeural Networks for Machine Learning and Deep Learning
Neural Networks for Machine Learning and Deep Learning
 
Introduction to Neural networks (under graduate course) Lecture 9 of 9
Introduction to Neural networks (under graduate course) Lecture 9 of 9Introduction to Neural networks (under graduate course) Lecture 9 of 9
Introduction to Neural networks (under graduate course) Lecture 9 of 9
 

More from SERC at Carleton College

StatVignette03_Sig.Figs_v04_07_15_2020.pptx
StatVignette03_Sig.Figs_v04_07_15_2020.pptxStatVignette03_Sig.Figs_v04_07_15_2020.pptx
StatVignette03_Sig.Figs_v04_07_15_2020.pptxSERC at Carleton College
 
Cretaceous Coatlines and Modern Voting Patterns Presentation
Cretaceous Coatlines and Modern Voting Patterns PresentationCretaceous Coatlines and Modern Voting Patterns Presentation
Cretaceous Coatlines and Modern Voting Patterns PresentationSERC at Carleton College
 
Climate and Biomes PPT 2
Climate and Biomes PPT 2Climate and Biomes PPT 2
Climate and Biomes PPT 2
SERC at Carleton College
 
weather tracking ppt
weather tracking pptweather tracking ppt
weather tracking ppt
SERC at Carleton College
 
Presentation: Unit 1 Introduction to the hydrological cycle
Presentation: Unit 1 Introduction to the hydrological cyclePresentation: Unit 1 Introduction to the hydrological cycle
Presentation: Unit 1 Introduction to the hydrological cycleSERC at Carleton College
 
KSKL_Chapter 4_ Chem Properties of Soils.pptx
KSKL_Chapter 4_ Chem Properties of Soils.pptxKSKL_Chapter 4_ Chem Properties of Soils.pptx
KSKL_Chapter 4_ Chem Properties of Soils.pptxSERC at Carleton College
 
Educators PPT file chapter 7
Educators PPT file chapter 7Educators PPT file chapter 7
Educators PPT file chapter 7
SERC at Carleton College
 
Educators PPT file chapter 2
Educators PPT file chapter 2Educators PPT file chapter 2
Educators PPT file chapter 2
SERC at Carleton College
 
Educators PPT file chapter 6
Educators PPT file chapter 6Educators PPT file chapter 6
Educators PPT file chapter 6
SERC at Carleton College
 
Educators PPT chapter 3
Educators PPT chapter 3Educators PPT chapter 3
Educators PPT chapter 3
SERC at Carleton College
 
Unit 4 background presentation
Unit 4 background presentationUnit 4 background presentation
Unit 4 background presentation
SERC at Carleton College
 
Presentation: Unit 3 background information
Presentation: Unit 3 background informationPresentation: Unit 3 background information
Presentation: Unit 3 background information
SERC at Carleton College
 
Presentation: Unit 2 Measuring Groundwater Background Information
Presentation: Unit 2 Measuring Groundwater Background InformationPresentation: Unit 2 Measuring Groundwater Background Information
Presentation: Unit 2 Measuring Groundwater Background Information
SERC at Carleton College
 

More from SERC at Carleton College (20)

StatVignette03_Sig.Figs_v04_07_15_2020.pptx
StatVignette03_Sig.Figs_v04_07_15_2020.pptxStatVignette03_Sig.Figs_v04_07_15_2020.pptx
StatVignette03_Sig.Figs_v04_07_15_2020.pptx
 
StatVignette06_HypTesting.pptx
StatVignette06_HypTesting.pptxStatVignette06_HypTesting.pptx
StatVignette06_HypTesting.pptx
 
Unit 1 (optional slides)
Unit 1 (optional slides)Unit 1 (optional slides)
Unit 1 (optional slides)
 
Cretaceous Coatlines and Modern Voting Patterns Presentation
Cretaceous Coatlines and Modern Voting Patterns PresentationCretaceous Coatlines and Modern Voting Patterns Presentation
Cretaceous Coatlines and Modern Voting Patterns Presentation
 
Climate and Biomes PPT 2
Climate and Biomes PPT 2Climate and Biomes PPT 2
Climate and Biomes PPT 2
 
weather tracking ppt
weather tracking pptweather tracking ppt
weather tracking ppt
 
Presentation: Unit 1 Introduction to the hydrological cycle
Presentation: Unit 1 Introduction to the hydrological cyclePresentation: Unit 1 Introduction to the hydrological cycle
Presentation: Unit 1 Introduction to the hydrological cycle
 
StatVignette05_M3_v02_10_21_2020.pptx
StatVignette05_M3_v02_10_21_2020.pptxStatVignette05_M3_v02_10_21_2020.pptx
StatVignette05_M3_v02_10_21_2020.pptx
 
KSKL chapter 8 PPT
KSKL chapter 8 PPTKSKL chapter 8 PPT
KSKL chapter 8 PPT
 
KSKL chap 5 PPT
KSKL chap 5 PPTKSKL chap 5 PPT
KSKL chap 5 PPT
 
KSKL_Chapter 4_ Chem Properties of Soils.pptx
KSKL_Chapter 4_ Chem Properties of Soils.pptxKSKL_Chapter 4_ Chem Properties of Soils.pptx
KSKL_Chapter 4_ Chem Properties of Soils.pptx
 
Degraded Soil Images.pptx
Degraded Soil Images.pptxDegraded Soil Images.pptx
Degraded Soil Images.pptx
 
Educators PPT file chapter 7
Educators PPT file chapter 7Educators PPT file chapter 7
Educators PPT file chapter 7
 
Educators PPT file chapter 2
Educators PPT file chapter 2Educators PPT file chapter 2
Educators PPT file chapter 2
 
Educators PPT file chapter 6
Educators PPT file chapter 6Educators PPT file chapter 6
Educators PPT file chapter 6
 
Educators PPT chapter 3
Educators PPT chapter 3Educators PPT chapter 3
Educators PPT chapter 3
 
Unit 4 background presentation
Unit 4 background presentationUnit 4 background presentation
Unit 4 background presentation
 
Presentation: Unit 3 background information
Presentation: Unit 3 background informationPresentation: Unit 3 background information
Presentation: Unit 3 background information
 
Presentation: Unit 2 Measuring Groundwater Background Information
Presentation: Unit 2 Measuring Groundwater Background InformationPresentation: Unit 2 Measuring Groundwater Background Information
Presentation: Unit 2 Measuring Groundwater Background Information
 
Introduction to GPS presentation
Introduction to GPS presentationIntroduction to GPS presentation
Introduction to GPS presentation
 

A principled way to principal components analysis

  • 1. A principled way to principal components analysis
  • 2. Teaching activity objectives • Visualize large data sets. • Transform the data to aid in this visualization. • Clustering data. • Implement basic linear algebra operations. • Connect this operations to neuronal models and brain function.
  • 3. Context for the activity • Homework Assignment in 9.40 Intro to neural Computation (Sophomore/Junior). • In-class activity 9.014 Quantitative Methods and Computational Models in Neuroscience (1st year PhD).
  • 5. MNIST data set 28 by 28 pixels 8-bit gray scale images These images live in a 784 dimensional space http://yann.lecun.com/exdb/mnist/
  • 6. Can we cluster images in the pixel space?
  • 7. One possible visualization There are more than 300000 possible pairwise pixel plots!!!
  • 8. Is there a more principled way? • Represent the data in a new basis set. • Aids in visualization and potentially in clustering and dimensionality reduction. • PCA provides such a basis set by looking at directions that capture most variance. • The directions are ranked by decreasing variance. • It diagonalizes the covariance matrix.
  • 9. Pedagogical approach • Guide them step by step to implement PCA. • Emphasize visualizations and geometrical approach/intuition. • We don’t use the MATLAB canned function for PCA. • We want students to get their hands “dirty”. This helps build confidence and deep understanding.
  • 10. PCA Mantra • Reshape the data to proper format for PCA. • Center the data performing mean subtraction. • Construct the data covariance matrix. • Perform SVD to obtain the eigenvalues and eigenvectors of the covariance matrix. • Compute the variance explained per component and plot it. • Reshape the eigenvectors and visualize their images. • Project the mean subtracted data onto the eigenvectors basis.
  • 12. Projections onto the first 2 axes • The first two PCs capture ~37% of the variance. • The data forms clear clusters that are almost linearly separable
  • 14. • 1949 book: 'The Organization of Behavior' Theory about the neural bases of learning • Learning takes place at synapses. • Synapses get modified, they get stronger when the pre- and post- synaptic cells fire together. • "Cells that fire together, wire together" Hebbian Learning Donald Hebb
  • 16. Erkki Oja Oja’s rule A simplified neuron model as a principal component analyzer. Journal of Mathematical Biology, 15:267-273 (1982). Feedback,forgetting term or regularizer • Stabilizes the Hebbian rule. • Leads to a covariance learning rule: the weights converge to the first eigenvector of the covariance matrix. • Similar to power iteration method.
  • 17. Learning outcomes • Visualize and manipulate a relatively large and complex data set. • Perform PCA by building it step by step. • Gain an intuition of the geometry involved in a change of basis and projections. • Start thinking about basic clustering algorithms. • Discuss on dimensionality reduction and other PCA applications
  • 18. Learning outcomes (cont) • Discuss the assumptions, limitations and shortcomings of applying PCA in different contexts. • Build a model of how PCA might actually take place in neural circuits. • Follow up: eigenfaces, is the brain doing PCA to recognize faces?