further update, added also

This commit is contained in:
mhjensen
2019-10-22 14:47:55 +02:00
parent 2a8cad73c5
commit 7fbad90972
37 changed files with 1245 additions and 899 deletions
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -221,7 +223,7 @@ MathJax.Hub.Config({
<li><a href="._DimRed-bs008.html">9</a></li>
<li><a href="._DimRed-bs009.html">10</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs001.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -221,7 +223,7 @@ data.
<li><a href="._DimRed-bs009.html">10</a></li>
<li><a href="._DimRed-bs010.html">11</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs002.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -220,7 +222,7 @@ ensures that all features are exactly between \( 0 \) and \( 1 \). The
<li><a href="._DimRed-bs010.html">11</a></li>
<li><a href="._DimRed-bs011.html">12</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs003.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -223,7 +225,7 @@ techniques.
<li><a href="._DimRed-bs011.html">12</a></li>
<li><a href="._DimRed-bs012.html">13</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs004.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -298,7 +300,7 @@ svm<span style="color: #666666">.</span>fit(X_train_scaled, y_train)
<li><a href="._DimRed-bs012.html">13</a></li>
<li><a href="._DimRed-bs013.html">14</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs005.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -248,7 +250,7 @@ svm<span style="color: #666666">.</span>fit(X_train_scaled, y_train)
<li><a href="._DimRed-bs013.html">14</a></li>
<li><a href="._DimRed-bs014.html">15</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs006.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -227,7 +229,7 @@ logreg<span style="color: #666666">.</span>fit(X_train_scaled, y_train)
<li><a href="._DimRed-bs014.html">15</a></li>
<li><a href="._DimRed-bs015.html">16</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs007.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -282,7 +284,7 @@ applications.
<li><a href="._DimRed-bs015.html">16</a></li>
<li><a href="._DimRed-bs016.html">17</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs008.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -212,7 +214,7 @@ We have a data set defined by a design/feature matrix \( \boldsymbol{X} \) (see
<li><a href="._DimRed-bs016.html">17</a></li>
<li><a href="._DimRed-bs017.html">18</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs009.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -261,7 +263,7 @@ In the above example this is the function we constructed using <b>pandas</b>.
<li><a href="._DimRed-bs017.html">18</a></li>
<li><a href="._DimRed-bs018.html">19</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs010.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -256,7 +258,7 @@ $$
<li><a href="._DimRed-bs018.html">19</a></li>
<li><a href="._DimRed-bs019.html">20</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs011.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -244,7 +246,7 @@ C <span style="color: #666666">=</span> np<span style="color: #666666">.</span>c
<li><a href="._DimRed-bs019.html">20</a></li>
<li><a href="._DimRed-bs020.html">21</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs012.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -246,7 +248,7 @@ The above procedure with <b>numpy</b> can be made more compact if we use <b>pand
<li><a href="._DimRed-bs020.html">21</a></li>
<li><a href="._DimRed-bs021.html">22</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs013.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -228,7 +230,7 @@ We expand this model to the Franke function discussed above.
<li><a href="._DimRed-bs021.html">22</a></li>
<li><a href="._DimRed-bs022.html">23</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs014.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -264,7 +266,7 @@ matrix.
<li><a href="._DimRed-bs022.html">23</a></li>
<li><a href="._DimRed-bs023.html">24</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs015.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -244,7 +246,7 @@ It is easy to generalize this to a matrix \( \boldsymbol{X}\in {\mathbb{R}}^{n\t
<li><a href="._DimRed-bs023.html">24</a></li>
<li><a href="._DimRed-bs024.html">25</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs016.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+38 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -213,6 +215,19 @@ $$
In the derivation of the PCA theorem we will assume that the eigenvalues are ordered in descending order, that is
\( \lambda_0 > \lambda_1 > \dots > \lambda_{p-1} \).
<p>
The eigenvalues tell us then how much we need to stretch the
corresponding eigenvectors. Dimensions with large eigenvalues have
thus large variations (large variance) and define therefore useful
dimensions. The data points are more spread out in the direction of
these eigenvectors. Smaller eigenvalues mean on the other hand that
the corresponding eigenvectors are shrunk accordingly and the data
points are tightly bunched together and there is not much variation in
these specific directions. Hopefully then we could leave it out
dimensions where the eigenvalues are very small. If \( p \) is very large,
we could then aim at reducing \( p \) to \( l < < p \) and handle only \( l \)
features/predictors.
<p>
<p>
<!-- navigation buttons at the bottom of the page -->
@@ -239,7 +254,7 @@ In the derivation of the PCA theorem we will assume that the eigenvalues are ord
<li><a href="._DimRed-bs024.html">25</a></li>
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs017.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+55 -24
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -178,7 +180,36 @@ MathJax.Hub.Config({
<a name="part0017"></a>
<!-- !split -->
<h2 id="___sec16" class="anchor">Classical PCA Theorem </h2>
<h2 id="___sec16" class="anchor">The Algorithm before theorem </h2>
<p>
Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here.
<ul>
<li> Set up the datapoints for the design/feature matrix \( \boldsymbol{X} \) with \( \boldsymbol{X}\in {\mathbb{R}}^{n\times p} \), with the predictors/features \( p \) referring to the column numbers and the entries \( n \) being the row elements.</li>
</ul>
$$
\boldsymbol{X}=\begin{bmatrix}
x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\
x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\
x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\
\dots & \dots & \dots & \dots \dots & \dots \\
x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\
x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\
\end{bmatrix},
$$
<ul>
<li> Center the data by subtracting the mean value for each column. This leads to a new matrix \( \boldsymbol{X}\rightarrow \overline{\boldsymbol{X}} \).</li>
<li> Compute then the covariance/correlation matrix $\mathbb{E}[\overline{\boldsymbol{X}}\overline{\boldsymbol{X}}^T].</li>
<li> Find the eigenpairs of \( \boldsymbol{C} \) with eigenvalues \( [\lambda_0,\lambda_1,\dots,\lambda_{p-1}] \) and eigenvectors \( [\boldsymbol{s}_0,\boldsymbol{s}_1,\dots,\boldsymbol{s}_{p-1}] \).</li>
<li> Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.</li>
<li> Keep only those \( l \) eigenvalues larger than a selected threshold value, discarding thus \( p-l \) features since we expect small variations in the data here.</li>
</ul>
After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.
<p>
<p>
@@ -206,7 +237,7 @@ MathJax.Hub.Config({
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs018.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+27 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -178,7 +180,7 @@ MathJax.Hub.Config({
<a name="part0018"></a>
<!-- !split -->
<h2 id="___sec17" class="anchor">Prof of the PCA Theorem </h2>
<h2 id="___sec17" class="anchor">Classical PCA Theorem </h2>
<p>
<p>
@@ -205,6 +207,8 @@ MathJax.Hub.Config({
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs019.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+26 -33
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -178,18 +180,8 @@ MathJax.Hub.Config({
<a name="part0019"></a>
<!-- !split -->
<h2 id="___sec18" class="anchor">Getting started with PCA </h2>
<h2 id="___sec18" class="anchor">Prof of the PCA Theorem </h2>
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #408080; font-style: italic"># Now add PCA</span>
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.decomposition</span> <span style="color: #008000; font-weight: bold">import</span> PCA
pca <span style="color: #666666">=</span> PCA(n_components <span style="color: #666666">=</span> <span style="color: #666666">2</span>)
pca<span style="color: #666666">.</span>fit(X_train_scaled)
X_pca <span style="color: #666666">=</span> pca<span style="color: #666666">.</span>transform(X_train_scaled)
</pre></div>
<p>
<p>
<!-- navigation buttons at the bottom of the page -->
@@ -214,6 +206,7 @@ X_pca <span style="color: #666666">=</span> pca<span style="color: #666666">.</s
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs020.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+31 -49
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -178,38 +180,17 @@ MathJax.Hub.Config({
<a name="part0020"></a>
<!-- !split -->
<h2 id="___sec19" class="anchor">Principal Component Analysis </h2>
<div class="panel panel-default">
<div class="panel-body">
<p> <!-- subsequent paragraphs come in larger fonts, so start with a paragraph -->
Principal Component Analysis (PCA) is by far the most popular dimensionality reduction algorithm.
First it identifies the hyperplane that lies closest to the data, and then it projects the data onto it.
<h2 id="___sec19" class="anchor">Getting started with PCA </h2>
<p>
The following Python code uses NumPy&#8217;s <b>svd()</b> function to obtain all the principal components of the
training set, then extracts the first two principal components
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>X_centered <span style="color: #666666">=</span> X <span style="color: #666666">-</span> X<span style="color: #666666">.</span>mean(axis<span style="color: #666666">=0</span>)
U, s, V <span style="color: #666666">=</span> np<span style="color: #666666">.</span>linalg<span style="color: #666666">.</span>svd(X_centered)
c1 <span style="color: #666666">=</span> V<span style="color: #666666">.</span>T[:, <span style="color: #666666">0</span>]
c2 <span style="color: #666666">=</span> V<span style="color: #666666">.</span>T[:, <span style="color: #666666">1</span>]
</pre></div>
<p>
PCA assumes that the dataset is centered around the origin. Scikit-Learn&#8217;s PCA classes take care of centering
the data for you. However, if you implement PCA yourself (as in the preceding example), or if you use other libraries, don&#8217;t
forget to center the data first.
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #408080; font-style: italic"># Now add PCA</span>
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.decomposition</span> <span style="color: #008000; font-weight: bold">import</span> PCA
pca <span style="color: #666666">=</span> PCA(n_components <span style="color: #666666">=</span> <span style="color: #666666">2</span>)
pca<span style="color: #666666">.</span>fit(X_train_scaled)
<p>
Once you have identified all the principal components, you can reduce the dimensionality of the dataset
down to \( d \) dimensions by projecting it onto the hyperplane defined by the first \( d \) principal components.
Selecting this hyperplane ensures that the projection will preserve as much variance as possible.
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>W2 <span style="color: #666666">=</span> V<span style="color: #666666">.</span>T[:, :<span style="color: #666666">2</span>]
X2D <span style="color: #666666">=</span> X_centered<span style="color: #666666">.</span>dot(W2)
X_pca <span style="color: #666666">=</span> pca<span style="color: #666666">.</span>transform(X_train_scaled)
</pre></div>
<p>
<p>
@@ -234,6 +215,7 @@ X2D <span style="color: #666666">=</span> X_centered<span style="color: #666666"
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs021.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+48 -40
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -176,36 +178,41 @@ MathJax.Hub.Config({
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <!-- add vertical space -->
<a name="part0021"></a>
<!-- !split -->
<!-- !split -->
<h2 id="___sec20" class="anchor">PCA and scikit-learn </h2>
<h2 id="___sec20" class="anchor">Principal Component Analysis </h2>
<div class="panel panel-default">
<div class="panel-body">
<p> <!-- subsequent paragraphs come in larger fonts, so start with a paragraph -->
Principal Component Analysis (PCA) is by far the most popular dimensionality reduction algorithm.
First it identifies the hyperplane that lies closest to the data, and then it projects the data onto it.
<p>
Scikit-Learn&#8217;s PCA class implements PCA using SVD decomposition just like we did before. The
following code applies PCA to reduce the dimensionality of the dataset down to two dimensions (note
that it automatically takes care of centering the data):
The following Python code uses NumPy&#8217;s <b>svd()</b> function to obtain all the principal components of the
training set, then extracts the first two principal components
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.decomposition</span> <span style="color: #008000; font-weight: bold">import</span> PCA
pca <span style="color: #666666">=</span> PCA(n_components <span style="color: #666666">=</span> <span style="color: #666666">2</span>)
X2D <span style="color: #666666">=</span> pca<span style="color: #666666">.</span>fit_transform(X)
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>X_centered <span style="color: #666666">=</span> X <span style="color: #666666">-</span> X<span style="color: #666666">.</span>mean(axis<span style="color: #666666">=0</span>)
U, s, V <span style="color: #666666">=</span> np<span style="color: #666666">.</span>linalg<span style="color: #666666">.</span>svd(X_centered)
c1 <span style="color: #666666">=</span> V<span style="color: #666666">.</span>T[:, <span style="color: #666666">0</span>]
c2 <span style="color: #666666">=</span> V<span style="color: #666666">.</span>T[:, <span style="color: #666666">1</span>]
</pre></div>
<p>
After fitting the PCA transformer to the dataset, you can access the principal components using the
components variable (note that it contains the PCs as horizontal vectors, so, for example, the first
principal component is equal to
PCA assumes that the dataset is centered around the origin. Scikit-Learn&#8217;s PCA classes take care of centering
the data for you. However, if you implement PCA yourself (as in the preceding example), or if you use other libraries, don&#8217;t
forget to center the data first.
<p>
Once you have identified all the principal components, you can reduce the dimensionality of the dataset
down to \( d \) dimensions by projecting it onto the hyperplane defined by the first \( d \) principal components.
Selecting this hyperplane ensures that the projection will preserve as much variance as possible.
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>pca<span style="color: #666666">.</span>components_<span style="color: #666666">.</span>T[:, <span style="color: #666666">0</span>])<span style="color: #666666">.</span>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>W2 <span style="color: #666666">=</span> V<span style="color: #666666">.</span>T[:, :<span style="color: #666666">2</span>]
X2D <span style="color: #666666">=</span> X_centered<span style="color: #666666">.</span>dot(W2)
</pre></div>
<p>
Another very useful piece of information is the explained variance ratio of each principal component,
available via the \( explained\_variance\_ratio \) variable. It indicates the proportion of the dataset&#8217;s
variance that lies along the axis of each principal component.
More material to come here.
<p>
<p>
<!-- navigation buttons at the bottom of the page -->
@@ -228,6 +235,7 @@ More material to come here.
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs022.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+43 -39
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -176,35 +178,36 @@ MathJax.Hub.Config({
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <!-- add vertical space -->
<a name="part0022"></a>
<!-- !split -->
<!-- !split -->
<h2 id="___sec21" class="anchor">More on the PCA </h2>
<h2 id="___sec21" class="anchor">PCA and scikit-learn </h2>
<p>
Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to
choose the number of dimensions that add up to a sufficiently large portion of the variance (e.g., 95%).
Unless, of course, you are reducing dimensionality for data visualization &#8212; in that case you will
generally want to reduce the dimensionality down to 2 or 3.
The following code computes PCA without reducing dimensionality, then computes the minimum number
of dimensions required to preserve 95% of the training set&#8217;s variance:
Scikit-Learn&#8217;s PCA class implements PCA using SVD decomposition just like we did before. The
following code applies PCA to reduce the dimensionality of the dataset down to two dimensions (note
that it automatically takes care of centering the data):
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>pca <span style="color: #666666">=</span> PCA()
pca<span style="color: #666666">.</span>fit(X)
cumsum <span style="color: #666666">=</span> np<span style="color: #666666">.</span>cumsum(pca<span style="color: #666666">.</span>explained_variance_ratio_)
d <span style="color: #666666">=</span> np<span style="color: #666666">.</span>argmax(cumsum <span style="color: #666666">&gt;=</span> <span style="color: #666666">0.95</span>) <span style="color: #666666">+</span> <span style="color: #666666">1</span>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.decomposition</span> <span style="color: #008000; font-weight: bold">import</span> PCA
pca <span style="color: #666666">=</span> PCA(n_components <span style="color: #666666">=</span> <span style="color: #666666">2</span>)
X2D <span style="color: #666666">=</span> pca<span style="color: #666666">.</span>fit_transform(X)
</pre></div>
<p>
You could then set \( n\_components=d \) and run PCA again. However, there is a much better option: instead
of specifying the number of principal components you want to preserve, you can set \( n\_components \) to be
a float between 0.0 and 1.0, indicating the ratio of variance you wish to preserve:
After fitting the PCA transformer to the dataset, you can access the principal components using the
components variable (note that it contains the PCs as horizontal vectors, so, for example, the first
principal component is equal to
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>pca <span style="color: #666666">=</span> PCA(n_components<span style="color: #666666">=0.95</span>)
X_reduced <span style="color: #666666">=</span> pca<span style="color: #666666">.</span>fit_transform(X)
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>pca<span style="color: #666666">.</span>components_<span style="color: #666666">.</span>T[:, <span style="color: #666666">0</span>])<span style="color: #666666">.</span>
</pre></div>
<p>
Another very useful piece of information is the explained variance ratio of each principal component,
available via the \( explained\_variance\_ratio \) variable. It indicates the proportion of the dataset&#8217;s
variance that lies along the axis of each principal component.
More material to come here.
<p>
<p>
<!-- navigation buttons at the bottom of the page -->
@@ -226,6 +229,7 @@ X_reduced <span style="color: #666666">=</span> pca<span style="color: #666666">
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs023.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+49 -28
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -178,15 +180,33 @@ MathJax.Hub.Config({
<a name="part0023"></a>
<!-- !split -->
<h2 id="___sec22" class="anchor">Incremental PCA </h2>
<h2 id="___sec22" class="anchor">More on the PCA </h2>
<p>
One problem with the preceding implementation of PCA is that it requires the whole training set to fit in
memory in order for the SVD algorithm to run. Fortunately, Incremental PCA (IPCA) algorithms have
been developed: you can split the training set into mini-batches and feed an IPCA algorithm one minibatch
at a time. This is useful for large training sets, and also to apply PCA online (i.e., on the fly, as new
instances arrive).
Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to
choose the number of dimensions that add up to a sufficiently large portion of the variance (e.g., 95%).
Unless, of course, you are reducing dimensionality for data visualization &#8212; in that case you will
generally want to reduce the dimensionality down to 2 or 3.
The following code computes PCA without reducing dimensionality, then computes the minimum number
of dimensions required to preserve 95% of the training set&#8217;s variance:
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>pca <span style="color: #666666">=</span> PCA()
pca<span style="color: #666666">.</span>fit(X)
cumsum <span style="color: #666666">=</span> np<span style="color: #666666">.</span>cumsum(pca<span style="color: #666666">.</span>explained_variance_ratio_)
d <span style="color: #666666">=</span> np<span style="color: #666666">.</span>argmax(cumsum <span style="color: #666666">&gt;=</span> <span style="color: #666666">0.95</span>) <span style="color: #666666">+</span> <span style="color: #666666">1</span>
</pre></div>
<p>
You could then set \( n\_components=d \) and run PCA again. However, there is a much better option: instead
of specifying the number of principal components you want to preserve, you can set \( n\_components \) to be
a float between 0.0 and 1.0, indicating the ratio of variance you wish to preserve:
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>pca <span style="color: #666666">=</span> PCA(n_components<span style="color: #666666">=0.95</span>)
X_reduced <span style="color: #666666">=</span> pca<span style="color: #666666">.</span>fit_transform(X)
</pre></div>
<p>
<p>
<!-- navigation buttons at the bottom of the page -->
@@ -207,6 +227,7 @@ instances arrive).
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs024.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+31 -32
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -178,18 +180,14 @@ MathJax.Hub.Config({
<a name="part0024"></a>
<!-- !split -->
<h2 id="___sec23" class="anchor">Randomized PCA </h2>
<h2 id="___sec23" class="anchor">Incremental PCA </h2>
<p>
Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic
algorithm that quickly finds an approximation of the first d principal components. Its computational
complexity is \( O(m \times d^2)+O(d^3) \), instead of \( O(m \times n^2) + O(n^3) \), so it is dramatically faster than the
previous algorithms when \( d \) is much smaller than \( n \).
<p>
</div>
</div>
One problem with the preceding implementation of PCA is that it requires the whole training set to fit in
memory in order for the SVD algorithm to run. Fortunately, Incremental PCA (IPCA) algorithms have
been developed: you can split the training set into mini-batches and feed an IPCA algorithm one minibatch
at a time. This is useful for large training sets, and also to apply PCA online (i.e., on the fly, as new
instances arrive).
<p>
<p>
@@ -210,6 +208,7 @@ previous algorithms when \( d \) is much smaller than \( n \).
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs025.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+30 -41
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -178,28 +180,14 @@ MathJax.Hub.Config({
<a name="part0025"></a>
<!-- !split -->
<h2 id="___sec24" class="anchor">Kernel PCA </h2>
<div class="panel panel-default">
<div class="panel-body">
<p> <!-- subsequent paragraphs come in larger fonts, so start with a paragraph -->
<h2 id="___sec24" class="anchor">Randomized PCA </h2>
<p>
The kernel trick is a mathematical technique that implicitly maps instances into a
very high-dimensional space (called the feature space), enabling nonlinear classification and regression
with Support Vector Machines. Recall that a linear decision boundary in the high-dimensional feature
space corresponds to a complex nonlinear decision boundary in the original space.
It turns out that the same trick can be applied to PCA, making it possible to perform complex nonlinear
projections for dimensionality reduction. This is called Kernel PCA (kPCA). It is often good at
preserving clusters of instances after projection, or sometimes even unrolling datasets that lie close to a
twisted manifold.
For example, the following code uses Scikit-Learn&#8217;s KernelPCA class to perform kPCA with an
<p>
Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic
algorithm that quickly finds an approximation of the first d principal components. Its computational
complexity is \( O(m \times d^2)+O(d^3) \), instead of \( O(m \times n^2) + O(n^3) \), so it is dramatically faster than the
previous algorithms when \( d \) is much smaller than \( n \).
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.decomposition</span> <span style="color: #008000; font-weight: bold">import</span> KernelPCA
rbf_pca <span style="color: #666666">=</span> KernelPCA(n_components <span style="color: #666666">=</span> <span style="color: #666666">2</span>, kernel<span style="color: #666666">=</span><span style="color: #BA2121">&quot;rbf&quot;</span>, gamma<span style="color: #666666">=0.04</span>)
X_reduced <span style="color: #666666">=</span> rbf_pca<span style="color: #666666">.</span>fit_transform(X)
</pre></div>
<p>
</div>
</div>
@@ -223,6 +211,7 @@ X_reduced <span style="color: #666666">=</span> rbf_pca<span style="color: #6666
<li class="active"><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs026.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+49 -28
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -178,14 +180,32 @@ MathJax.Hub.Config({
<a name="part0026"></a>
<!-- !split -->
<h2 id="___sec25" class="anchor">LLE </h2>
<h2 id="___sec25" class="anchor">Kernel PCA </h2>
<div class="panel panel-default">
<div class="panel-body">
<p> <!-- subsequent paragraphs come in larger fonts, so start with a paragraph -->
<p>
Locally Linear Embedding (LLE) is another very powerful nonlinear dimensionality reduction
(NLDR) technique. It is a Manifold Learning technique that does not rely on projections like the previous
algorithms. In a nutshell, LLE works by first measuring how each training instance linearly relates to its
closest neighbors (c.n.), and then looking for a low-dimensional representation of the training set where
these local relationships are best preserved (more details shortly).
The kernel trick is a mathematical technique that implicitly maps instances into a
very high-dimensional space (called the feature space), enabling nonlinear classification and regression
with Support Vector Machines. Recall that a linear decision boundary in the high-dimensional feature
space corresponds to a complex nonlinear decision boundary in the original space.
It turns out that the same trick can be applied to PCA, making it possible to perform complex nonlinear
projections for dimensionality reduction. This is called Kernel PCA (kPCA). It is often good at
preserving clusters of instances after projection, or sometimes even unrolling datasets that lie close to a
twisted manifold.
For example, the following code uses Scikit-Learn&#8217;s KernelPCA class to perform kPCA with an
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">sklearn.decomposition</span> <span style="color: #008000; font-weight: bold">import</span> KernelPCA
rbf_pca <span style="color: #666666">=</span> KernelPCA(n_components <span style="color: #666666">=</span> <span style="color: #666666">2</span>, kernel<span style="color: #666666">=</span><span style="color: #BA2121">&quot;rbf&quot;</span>, gamma<span style="color: #666666">=0.04</span>)
X_reduced <span style="color: #666666">=</span> rbf_pca<span style="color: #666666">.</span>fit_transform(X)
</pre></div>
<p>
</div>
</div>
<p>
<p>
@@ -204,6 +224,7 @@ these local relationships are best preserved (more details shortly).
<li><a href="._DimRed-bs025.html">26</a></li>
<li class="active"><a href="._DimRed-bs026.html">27</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs027.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+32 -89
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -178,77 +180,16 @@ MathJax.Hub.Config({
<a name="part0027"></a>
<!-- !split -->
<h2 id="___sec26" class="anchor">Other techniques </h2>
<h2 id="___sec26" class="anchor">LLE </h2>
<p>
There are many other dimensionality reduction techniques, several of which are available in Scikit-Learn.
Locally Linear Embedding (LLE) is another very powerful nonlinear dimensionality reduction
(NLDR) technique. It is a Manifold Learning technique that does not rely on projections like the previous
algorithms. In a nutshell, LLE works by first measuring how each training instance linearly relates to its
closest neighbors (c.n.), and then looking for a low-dimensional representation of the training set where
these local relationships are best preserved (more details shortly).
<p>
Here are some of the most popular:
<ul>
<li> <b>Multidimensional Scaling (MDS)</b> reduces dimensionality while trying to preserve the distances between the instances.</li>
<li> <b>Isomap</b> creates a graph by connecting each instance to its nearest neighbors, then reduces dimensionality while trying to preserve the geodesic distances between the instances.</li>
<li> <b>t-Distributed Stochastic Neighbor Embedding</b> (t-SNE) reduces dimensionality while trying to keep similar instances close and dissimilar instances apart. It is mostly used for visualization, in particular to visualize clusters of instances in high-dimensional space (e.g., to visualize the MNIST images in 2D).</li>
<li> Linear Discriminant Analysis (LDA) is actually a classification algorithm, but during training it learns the most discriminative axes between the classes, and these axes can then be used to define a hyperplane onto which to project the data. The benefit is that the projection will keep classes as far apart as possible, so LDA is a good technique to reduce dimensionality before running another classification algorithm such as a Support Vector Machine (SVM) classifier discussed in the SVM lectures.</li>
</ul>
Here are other examples where we use the <b>DataFrame</b> functionality to handle arrays, now with more interesting features for us, namely numbers. We set up a matrix
of dimensionality \( 10\times 5 \) and compute the mean value and standard deviation of each column. Similarly, we can perform mathematial operations like squaring the matrix elements and many other operations.
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">numpy</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">np</span>
<span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">pandas</span> <span style="color: #008000; font-weight: bold">as</span> <span style="color: #0000FF; font-weight: bold">pd</span>
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">IPython.display</span> <span style="color: #008000; font-weight: bold">import</span> display
np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>seed(<span style="color: #666666">100</span>)
<span style="color: #408080; font-style: italic"># setting up a 10 x 5 matrix</span>
rows <span style="color: #666666">=</span> <span style="color: #666666">10</span>
cols <span style="color: #666666">=</span> <span style="color: #666666">5</span>
a <span style="color: #666666">=</span> np<span style="color: #666666">.</span>random<span style="color: #666666">.</span>randn(rows,cols)
df <span style="color: #666666">=</span> pd<span style="color: #666666">.</span>DataFrame(a)
display(df)
<span style="color: #008000; font-weight: bold">print</span>(df<span style="color: #666666">.</span>mean())
<span style="color: #008000; font-weight: bold">print</span>(df<span style="color: #666666">.</span>std())
display(df<span style="color: #666666">**2</span>)
</pre></div>
<p>
Thereafter we can select specific columns only and plot final results
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>df<span style="color: #666666">.</span>columns <span style="color: #666666">=</span> [<span style="color: #BA2121">&#39;First&#39;</span>, <span style="color: #BA2121">&#39;Second&#39;</span>, <span style="color: #BA2121">&#39;Third&#39;</span>, <span style="color: #BA2121">&#39;Fourth&#39;</span>, <span style="color: #BA2121">&#39;Fifth&#39;</span>]
df<span style="color: #666666">.</span>index <span style="color: #666666">=</span> np<span style="color: #666666">.</span>arange(<span style="color: #666666">10</span>)
display(df)
<span style="color: #008000; font-weight: bold">print</span>(df[<span style="color: #BA2121">&#39;Second&#39;</span>]<span style="color: #666666">.</span>mean() )
<span style="color: #008000; font-weight: bold">print</span>(df<span style="color: #666666">.</span>info())
<span style="color: #008000; font-weight: bold">print</span>(df<span style="color: #666666">.</span>describe())
<span style="color: #008000; font-weight: bold">from</span> <span style="color: #0000FF; font-weight: bold">pylab</span> <span style="color: #008000; font-weight: bold">import</span> plt, mpl
plt<span style="color: #666666">.</span>style<span style="color: #666666">.</span>use(<span style="color: #BA2121">&#39;seaborn&#39;</span>)
mpl<span style="color: #666666">.</span>rcParams[<span style="color: #BA2121">&#39;font.family&#39;</span>] <span style="color: #666666">=</span> <span style="color: #BA2121">&#39;serif&#39;</span>
df<span style="color: #666666">.</span>cumsum()<span style="color: #666666">.</span>plot(lw<span style="color: #666666">=2.0</span>, figsize<span style="color: #666666">=</span>(<span style="color: #666666">10</span>,<span style="color: #666666">6</span>))
plt<span style="color: #666666">.</span>show()
df<span style="color: #666666">.</span>plot<span style="color: #666666">.</span>bar(figsize<span style="color: #666666">=</span>(<span style="color: #666666">10</span>,<span style="color: #666666">6</span>), rot<span style="color: #666666">=15</span>)
plt<span style="color: #666666">.</span>show()
</pre></div>
<p>
We can produce a \( 4\times 4 \) matrix
<p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>b <span style="color: #666666">=</span> np<span style="color: #666666">.</span>arange(<span style="color: #666666">16</span>)<span style="color: #666666">.</span>reshape((<span style="color: #666666">4</span>,<span style="color: #666666">4</span>))
<span style="color: #008000; font-weight: bold">print</span>(b)
df1 <span style="color: #666666">=</span> pd<span style="color: #666666">.</span>DataFrame(b)
<span style="color: #008000; font-weight: bold">print</span>(df1)
</pre></div>
<p>
and many other operations.
<p>
<!-- navigation buttons at the bottom of the page -->
<ul class="pagination">
@@ -264,6 +205,8 @@ and many other operations.
<li><a href="._DimRed-bs025.html">26</a></li>
<li><a href="._DimRed-bs026.html">27</a></li>
<li class="active"><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs028.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+25 -23
View File
@@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -152,17 +153,18 @@ MathJax.Hub.Config({
<!-- navigation toc: --> <li><a href="._DimRed-bs014.html#___sec13" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs015.html#___sec14" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs016.html#___sec15" style="font-size: 80%;">Towards the PCA theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">Other techniques</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs017.html#___sec16" style="font-size: 80%;">The Algorithm before the Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs018.html#___sec17" style="font-size: 80%;">Classical PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs019.html#___sec18" style="font-size: 80%;">Prof of the PCA Theorem</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs020.html#___sec19" style="font-size: 80%;">Getting started with PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs021.html#___sec20" style="font-size: 80%;">Principal Component Analysis</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs022.html#___sec21" style="font-size: 80%;">PCA and scikit-learn</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs023.html#___sec22" style="font-size: 80%;">More on the PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs024.html#___sec23" style="font-size: 80%;">Incremental PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs025.html#___sec24" style="font-size: 80%;">Randomized PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs026.html#___sec25" style="font-size: 80%;">Kernel PCA</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs027.html#___sec26" style="font-size: 80%;">LLE</a></li>
<!-- navigation toc: --> <li><a href="._DimRed-bs028.html#___sec27" style="font-size: 80%;">Other techniques</a></li>
</ul>
</li>
@@ -221,7 +223,7 @@ MathJax.Hub.Config({
<li><a href="._DimRed-bs008.html">9</a></li>
<li><a href="._DimRed-bs009.html">10</a></li>
<li><a href="">...</a></li>
<li><a href="._DimRed-bs027.html">28</a></li>
<li><a href="._DimRed-bs028.html">29</a></li>
<li><a href="._DimRed-bs001.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
+60 -11
View File
@@ -936,21 +936,70 @@ $$
<p>
In the derivation of the PCA theorem we will assume that the eigenvalues are ordered in descending order, that is
\( \lambda_0 > \lambda_1 > \dots > \lambda_{p-1} \).
<p>
The eigenvalues tell us then how much we need to stretch the
corresponding eigenvectors. Dimensions with large eigenvalues have
thus large variations (large variance) and define therefore useful
dimensions. The data points are more spread out in the direction of
these eigenvectors. Smaller eigenvalues mean on the other hand that
the corresponding eigenvectors are shrunk accordingly and the data
points are tightly bunched together and there is not much variation in
these specific directions. Hopefully then we could leave it out
dimensions where the eigenvalues are very small. If \( p \) is very large,
we could then aim at reducing \( p \) to \( l < < p \) and handle only \( l \)
features/predictors.
</section>
<section>
<h2 id="___sec16">Classical PCA Theorem </h2>
<h2 id="___sec16">The Algorithm before theorem </h2>
<p>
Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here.
<ul>
<p><li> Set up the datapoints for the design/feature matrix \( \boldsymbol{X} \) with \( \boldsymbol{X}\in {\mathbb{R}}^{n\times p} \), with the predictors/features \( p \) referring to the column numbers and the entries \( n \) being the row elements.</li>
</ul>
<p>&nbsp;<br>
$$
\boldsymbol{X}=\begin{bmatrix}
x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\
x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\
x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\
\dots & \dots & \dots & \dots \dots & \dots \\
x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\
x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\
\end{bmatrix},
$$
<p>&nbsp;<br>
<ul>
<p><li> Center the data by subtracting the mean value for each column. This leads to a new matrix \( \boldsymbol{X}\rightarrow \overline{\boldsymbol{X}} \).</li>
<p><li> Compute then the covariance/correlation matrix $\mathbb{E}[\overline{\boldsymbol{X}}\overline{\boldsymbol{X}}^T].</li>
<p><li> Find the eigenpairs of \( \boldsymbol{C} \) with eigenvalues \( [\lambda_0,\lambda_1,\dots,\lambda_{p-1}] \) and eigenvectors \( [\boldsymbol{s}_0,\boldsymbol{s}_1,\dots,\boldsymbol{s}_{p-1}] \).</li>
<p><li> Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.</li>
<p><li> Keep only those \( l \) eigenvalues larger than a selected threshold value, discarding thus \( p-l \) features since we expect small variations in the data here.</li>
</ul>
<p>
After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.
</section>
<section>
<h2 id="___sec17">Prof of the PCA Theorem </h2>
<h2 id="___sec17">Classical PCA Theorem </h2>
</section>
<section>
<h2 id="___sec18">Getting started with PCA </h2>
<h2 id="___sec18">Prof of the PCA Theorem </h2>
</section>
<section>
<h2 id="___sec19">Getting started with PCA </h2>
<p>
@@ -966,7 +1015,7 @@ X_pca = pca.transform(X_train_scaled)
<section>
<h2 id="___sec19">Principal Component Analysis </h2>
<h2 id="___sec20">Principal Component Analysis </h2>
<div class="alert alert-block alert-block alert-text-normal">
<b></b>
<p>
@@ -1003,7 +1052,7 @@ X2D = X_centered.dot(W2)
<section>
<h2 id="___sec20">PCA and scikit-learn </h2>
<h2 id="___sec21">PCA and scikit-learn </h2>
<p>
Scikit-Learn&#8217;s PCA class implements PCA using SVD decomposition just like we did before. The
@@ -1034,7 +1083,7 @@ More material to come here.
<section>
<h2 id="___sec21">More on the PCA </h2>
<h2 id="___sec22">More on the PCA </h2>
<p>
Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to
@@ -1065,7 +1114,7 @@ X_reduced = pca.fit_transform(X)
<section>
<h2 id="___sec22">Incremental PCA </h2>
<h2 id="___sec23">Incremental PCA </h2>
<p>
One problem with the preceding implementation of PCA is that it requires the whole training set to fit in
@@ -1077,7 +1126,7 @@ instances arrive).
<section>
<h2 id="___sec23">Randomized PCA </h2>
<h2 id="___sec24">Randomized PCA </h2>
<p>
Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic
@@ -1091,7 +1140,7 @@ previous algorithms when \( d \) is much smaller than \( n \).
<section>
<h2 id="___sec24">Kernel PCA </h2>
<h2 id="___sec25">Kernel PCA </h2>
<div class="alert alert-block alert-block alert-text-normal">
<b></b>
<p>
@@ -1117,7 +1166,7 @@ X_reduced = rbf_pca.fit_transform(X)
<section>
<h2 id="___sec25">LLE </h2>
<h2 id="___sec26">LLE </h2>
<p>
Locally Linear Embedding (LLE) is another very powerful nonlinear dimensionality reduction
@@ -1129,7 +1178,7 @@ these local relationships are best preserved (more details shortly).
<section>
<h2 id="___sec26">Other techniques </h2>
<h2 id="___sec27">Other techniques </h2>
<p>
There are many other dimensionality reduction techniques, several of which are available in Scikit-Learn.
+72 -24
View File
@@ -108,17 +108,18 @@ div { text-align: justify; text-justify: inter-word; }
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -903,19 +904,66 @@ In the derivation of the PCA theorem we will assume that the eigenvalues are ord
\( \lambda_0 > \lambda_1 > \dots > \lambda_{p-1} \).
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec16">Classical PCA Theorem </h2>
The eigenvalues tell us then how much we need to stretch the
corresponding eigenvectors. Dimensions with large eigenvalues have
thus large variations (large variance) and define therefore useful
dimensions. The data points are more spread out in the direction of
these eigenvectors. Smaller eigenvalues mean on the other hand that
the corresponding eigenvectors are shrunk accordingly and the data
points are tightly bunched together and there is not much variation in
these specific directions. Hopefully then we could leave it out
dimensions where the eigenvalues are very small. If \( p \) is very large,
we could then aim at reducing \( p \) to \( l < < p \) and handle only \( l \)
features/predictors.
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec17">Prof of the PCA Theorem </h2>
<h2 id="___sec16">The Algorithm before theorem </h2>
<p>
Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here.
<ul>
<li> Set up the datapoints for the design/feature matrix \( \boldsymbol{X} \) with \( \boldsymbol{X}\in {\mathbb{R}}^{n\times p} \), with the predictors/features \( p \) referring to the column numbers and the entries \( n \) being the row elements.</li>
</ul>
$$
\boldsymbol{X}=\begin{bmatrix}
x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\
x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\
x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\
\dots & \dots & \dots & \dots \dots & \dots \\
x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\
x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\
\end{bmatrix},
$$
<ul>
<li> Center the data by subtracting the mean value for each column. This leads to a new matrix \( \boldsymbol{X}\rightarrow \overline{\boldsymbol{X}} \).</li>
<li> Compute then the covariance/correlation matrix $\mathbb{E}[\overline{\boldsymbol{X}}\overline{\boldsymbol{X}}^T].</li>
<li> Find the eigenpairs of \( \boldsymbol{C} \) with eigenvalues \( [\lambda_0,\lambda_1,\dots,\lambda_{p-1}] \) and eigenvectors \( [\boldsymbol{s}_0,\boldsymbol{s}_1,\dots,\boldsymbol{s}_{p-1}] \).</li>
<li> Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.</li>
<li> Keep only those \( l \) eigenvalues larger than a selected threshold value, discarding thus \( p-l \) features since we expect small variations in the data here.</li>
</ul>
After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec18">Getting started with PCA </h2>
<h2 id="___sec17">Classical PCA Theorem </h2>
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec18">Prof of the PCA Theorem </h2>
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec19">Getting started with PCA </h2>
<p>
@@ -930,7 +978,7 @@ X_pca = pca.transform(X_train_scaled)
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec19">Principal Component Analysis </h2>
<h2 id="___sec20">Principal Component Analysis </h2>
<div class="alert alert-block alert-block alert-text-normal">
<b></b>
<p>
@@ -966,7 +1014,7 @@ X2D = X_centered.dot(W2)
<p>
<!-- !split -->
<h2 id="___sec20">PCA and scikit-learn </h2>
<h2 id="___sec21">PCA and scikit-learn </h2>
<p>
Scikit-Learn&#8217;s PCA class implements PCA using SVD decomposition just like we did before. The
@@ -997,7 +1045,7 @@ More material to come here.
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec21">More on the PCA </h2>
<h2 id="___sec22">More on the PCA </h2>
<p>
Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to
@@ -1027,7 +1075,7 @@ X_reduced = pca.fit_transform(X)
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec22">Incremental PCA </h2>
<h2 id="___sec23">Incremental PCA </h2>
<p>
One problem with the preceding implementation of PCA is that it requires the whole training set to fit in
@@ -1039,7 +1087,7 @@ instances arrive).
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec23">Randomized PCA </h2>
<h2 id="___sec24">Randomized PCA </h2>
<p>
Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic
@@ -1054,7 +1102,7 @@ previous algorithms when \( d \) is much smaller than \( n \).
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec24">Kernel PCA </h2>
<h2 id="___sec25">Kernel PCA </h2>
<div class="alert alert-block alert-block alert-text-normal">
<b></b>
<p>
@@ -1083,7 +1131,7 @@ X_reduced = rbf_pca.fit_transform(X)
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec25">LLE </h2>
<h2 id="___sec26">LLE </h2>
<p>
Locally Linear Embedding (LLE) is another very powerful nonlinear dimensionality reduction
@@ -1095,7 +1143,7 @@ these local relationships are best preserved (more details shortly).
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec26">Other techniques </h2>
<h2 id="___sec27">Other techniques </h2>
<p>
There are many other dimensionality reduction techniques, several of which are available in Scikit-Learn.
+72 -24
View File
@@ -113,17 +113,18 @@ div { text-align: justify; text-justify: inter-word; }
None,
'___sec14'),
('Towards the PCA theorem', 2, None, '___sec15'),
('Classical PCA Theorem', 2, None, '___sec16'),
('Prof of the PCA Theorem', 2, None, '___sec17'),
('Getting started with PCA', 2, None, '___sec18'),
('Principal Component Analysis', 2, None, '___sec19'),
('PCA and scikit-learn', 2, None, '___sec20'),
('More on the PCA', 2, None, '___sec21'),
('Incremental PCA', 2, None, '___sec22'),
('Randomized PCA', 2, None, '___sec23'),
('Kernel PCA', 2, None, '___sec24'),
('LLE', 2, None, '___sec25'),
('Other techniques', 2, None, '___sec26')]}
('The Algorithm before the Theorem', 2, None, '___sec16'),
('Classical PCA Theorem', 2, None, '___sec17'),
('Prof of the PCA Theorem', 2, None, '___sec18'),
('Getting started with PCA', 2, None, '___sec19'),
('Principal Component Analysis', 2, None, '___sec20'),
('PCA and scikit-learn', 2, None, '___sec21'),
('More on the PCA', 2, None, '___sec22'),
('Incremental PCA', 2, None, '___sec23'),
('Randomized PCA', 2, None, '___sec24'),
('Kernel PCA', 2, None, '___sec25'),
('LLE', 2, None, '___sec26'),
('Other techniques', 2, None, '___sec27')]}
end of tocinfo -->
<body>
@@ -908,19 +909,66 @@ In the derivation of the PCA theorem we will assume that the eigenvalues are ord
\( \lambda_0 > \lambda_1 > \dots > \lambda_{p-1} \).
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec16">Classical PCA Theorem </h2>
The eigenvalues tell us then how much we need to stretch the
corresponding eigenvectors. Dimensions with large eigenvalues have
thus large variations (large variance) and define therefore useful
dimensions. The data points are more spread out in the direction of
these eigenvectors. Smaller eigenvalues mean on the other hand that
the corresponding eigenvectors are shrunk accordingly and the data
points are tightly bunched together and there is not much variation in
these specific directions. Hopefully then we could leave it out
dimensions where the eigenvalues are very small. If \( p \) is very large,
we could then aim at reducing \( p \) to \( l < < p \) and handle only \( l \)
features/predictors.
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec17">Prof of the PCA Theorem </h2>
<h2 id="___sec16">The Algorithm before theorem </h2>
<p>
Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here.
<ul>
<li> Set up the datapoints for the design/feature matrix \( \boldsymbol{X} \) with \( \boldsymbol{X}\in {\mathbb{R}}^{n\times p} \), with the predictors/features \( p \) referring to the column numbers and the entries \( n \) being the row elements.</li>
</ul>
$$
\boldsymbol{X}=\begin{bmatrix}
x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\
x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\
x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\
\dots & \dots & \dots & \dots \dots & \dots \\
x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\
x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\
\end{bmatrix},
$$
<ul>
<li> Center the data by subtracting the mean value for each column. This leads to a new matrix \( \boldsymbol{X}\rightarrow \overline{\boldsymbol{X}} \).</li>
<li> Compute then the covariance/correlation matrix $\mathbb{E}[\overline{\boldsymbol{X}}\overline{\boldsymbol{X}}^T].</li>
<li> Find the eigenpairs of \( \boldsymbol{C} \) with eigenvalues \( [\lambda_0,\lambda_1,\dots,\lambda_{p-1}] \) and eigenvectors \( [\boldsymbol{s}_0,\boldsymbol{s}_1,\dots,\boldsymbol{s}_{p-1}] \).</li>
<li> Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.</li>
<li> Keep only those \( l \) eigenvalues larger than a selected threshold value, discarding thus \( p-l \) features since we expect small variations in the data here.</li>
</ul>
After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec18">Getting started with PCA </h2>
<h2 id="___sec17">Classical PCA Theorem </h2>
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec18">Prof of the PCA Theorem </h2>
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec19">Getting started with PCA </h2>
<p>
@@ -935,7 +983,7 @@ X_pca <span style="color: #666666">=</span> pca<span style="color: #666666">.</s
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec19">Principal Component Analysis </h2>
<h2 id="___sec20">Principal Component Analysis </h2>
<div class="alert alert-block alert-block alert-text-normal">
<b></b>
<p>
@@ -971,7 +1019,7 @@ X2D <span style="color: #666666">=</span> X_centered<span style="color: #666666"
<p>
<!-- !split -->
<h2 id="___sec20">PCA and scikit-learn </h2>
<h2 id="___sec21">PCA and scikit-learn </h2>
<p>
Scikit-Learn&#8217;s PCA class implements PCA using SVD decomposition just like we did before. The
@@ -1002,7 +1050,7 @@ More material to come here.
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec21">More on the PCA </h2>
<h2 id="___sec22">More on the PCA </h2>
<p>
Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to
@@ -1032,7 +1080,7 @@ X_reduced <span style="color: #666666">=</span> pca<span style="color: #666666">
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec22">Incremental PCA </h2>
<h2 id="___sec23">Incremental PCA </h2>
<p>
One problem with the preceding implementation of PCA is that it requires the whole training set to fit in
@@ -1044,7 +1092,7 @@ instances arrive).
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec23">Randomized PCA </h2>
<h2 id="___sec24">Randomized PCA </h2>
<p>
Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic
@@ -1059,7 +1107,7 @@ previous algorithms when \( d \) is much smaller than \( n \).
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec24">Kernel PCA </h2>
<h2 id="___sec25">Kernel PCA </h2>
<div class="alert alert-block alert-block alert-text-normal">
<b></b>
<p>
@@ -1088,7 +1136,7 @@ X_reduced <span style="color: #666666">=</span> rbf_pca<span style="color: #6666
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec25">LLE </h2>
<h2 id="___sec26">LLE </h2>
<p>
Locally Linear Embedding (LLE) is another very powerful nonlinear dimensionality reduction
@@ -1100,7 +1148,7 @@ these local relationships are best preserved (more details shortly).
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
<h2 id="___sec26">Other techniques </h2>
<h2 id="___sec27">Other techniques </h2>
<p>
There are many other dimensionality reduction techniques, several of which are available in Scikit-Learn.
+51
View File
@@ -1000,6 +1000,57 @@
"In the derivation of the PCA theorem we will assume that the eigenvalues are ordered in descending order, that is\n",
"$\\lambda_0 > \\lambda_1 > \\dots > \\lambda_{p-1}$. \n",
"\n",
"\n",
"The eigenvalues tell us then how much we need to stretch the\n",
"corresponding eigenvectors. Dimensions with large eigenvalues have\n",
"thus large variations (large variance) and define therefore useful\n",
"dimensions. The data points are more spread out in the direction of\n",
"these eigenvectors. Smaller eigenvalues mean on the other hand that\n",
"the corresponding eigenvectors are shrunk accordingly and the data\n",
"points are tightly bunched together and there is not much variation in\n",
"these specific directions. Hopefully then we could leave it out\n",
"dimensions where the eigenvalues are very small. If $p$ is very large,\n",
"we could then aim at reducing $p$ to $l << p$ and handle only $l$\n",
"features/predictors.\n",
"\n",
"## The Algorithm before theorem\n",
"\n",
"Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here. \n",
"* Set up the datapoints for the design/feature matrix $\\boldsymbol{X}$ with $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times p}$, with the predictors/features $p$ referring to the column numbers and the entries $n$ being the row elements."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix}\n",
"x_{0,0} & x_{0,1} & x_{0,2}& \\dots & \\dots x_{0,p-1}\\\\\n",
"x_{1,0} & x_{1,1} & x_{1,2}& \\dots & \\dots x_{1,p-1}\\\\\n",
"x_{2,0} & x_{2,1} & x_{2,2}& \\dots & \\dots x_{2,p-1}\\\\\n",
"\\dots & \\dots & \\dots & \\dots \\dots & \\dots \\\\\n",
"x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \\dots & \\dots x_{n-2,p-1}\\\\\n",
"x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \\dots & \\dots x_{n-1,p-1}\\\\\n",
"\\end{bmatrix},\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* Center the data by subtracting the mean value for each column. This leads to a new matrix $\\boldsymbol{X}\\rightarrow \\overline{\\boldsymbol{X}}$.\n",
"\n",
"* Compute then the covariance/correlation matrix $\\mathbb{E}[\\overline{\\boldsymbol{X}}\\overline{\\boldsymbol{X}}^T].\n",
"\n",
"* Find the eigenpairs of $\\boldsymbol{C}$ with eigenvalues $[\\lambda_0,\\lambda_1,\\dots,\\lambda_{p-1}]$ and eigenvectors $[\\boldsymbol{s}_0,\\boldsymbol{s}_1,\\dots,\\boldsymbol{s}_{p-1}]$.\n",
"\n",
"* Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.\n",
"\n",
"* Keep only those $l$ eigenvalues larger than a selected threshold value, discarding thus $p-l$ features since we expect small variations in the data here.\n",
"\n",
"After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.\n",
"\n",
"## Classical PCA Theorem\n",
"\n",
"\n",
Binary file not shown.
Binary file not shown.
+38
View File
@@ -703,6 +703,44 @@ and since $\bm{C}[\bm{y}]$ is diagonal we have for a given eigenvalue $i$ of the
In the derivation of the PCA theorem we will assume that the eigenvalues are ordered in descending order, that is
$\lambda_0 > \lambda_1 > \dots > \lambda_{p-1}$.
The eigenvalues tell us then how much we need to stretch the
corresponding eigenvectors. Dimensions with large eigenvalues have
thus large variations (large variance) and define therefore useful
dimensions. The data points are more spread out in the direction of
these eigenvectors. Smaller eigenvalues mean on the other hand that
the corresponding eigenvectors are shrunk accordingly and the data
points are tightly bunched together and there is not much variation in
these specific directions. Hopefully then we could leave it out
dimensions where the eigenvalues are very small. If $p$ is very large,
we could then aim at reducing $p$ to $l << p$ and handle only $l$
features/predictors.
!split
===== The Algorithm before the Theorem =====
Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here.
* Set up the datapoints for the design/feature matrix $\bm{X}$ with $\bm{X}\in {\mathbb{R}}^{n\times p}$, with the predictors/features $p$ referring to the column numbers and the entries $n$ being the row elements.
!bt
\[
\bm{X}=\begin{bmatrix}
x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\
x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\
x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\
\dots & \dots & \dots & \dots \dots & \dots \\
x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\
x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\
\end{bmatrix},
\]
!et
* Center the data by subtracting the mean value for each column. This leads to a new matrix $\bm{X}\rightarrow \overline{\bm{X}}$.
* Compute then the covariance/correlation matrix $\mathbb{E}[\overline{\bm{X}}\overline{\bm{X}}^T].
* Find the eigenpairs of $\bm{C}$ with eigenvalues $[\lambda_0,\lambda_1,\dots,\lambda_{p-1}]$ and eigenvectors $[\bm{s}_0,\bm{s}_1,\dots,\bm{s}_{p-1}]$.
* Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.
* Keep only those $l$ eigenvalues larger than a selected threshold value, discarding thus $p-l$ features since we expect small variations in the data here.
After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.
!split
===== Classical PCA Theorem =====
+68
View File
@@ -0,0 +1,68 @@
# Common imports
import numpy as np
from sklearn.neural_network import MLPRegressor
from sklearn.metrics import accuracy_score
import seaborn as sns
import matplotlib.pyplot as plt
def FrankeFunction(x,y):
term1 = 0.75*np.exp(-(0.25*(9*x-2)**2) - 0.25*((9*y-2)**2))
term2 = 0.75*np.exp(-((9*x+1)**2)/49.0 - 0.1*(9*y+1))
term3 = 0.5*np.exp(-(9*x-7)**2/4.0 - 0.25*((9*y-3)**2))
term4 = -0.2*np.exp(-(9*x-4)**2 - (9*y-7)**2)
return term1 + term2 + term3 + term4
def create_X(x, y, n ):
if len(x.shape) > 1:
x = np.ravel(x)
y = np.ravel(y)
N = len(x)
l = int((n+1)*(n+2)/2) # Number of elements in beta
X = np.ones((N,l))
for i in range(1,n+1):
q = int((i)*(i+1)/2)
for k in range(i+1):
X[:,q+k] = (x**(i-k))*(y**k)
return X
# Making meshgrid of datapoints and compute Franke's function
n = 4
N = 100
x = np.sort(np.random.uniform(0, 1, N))
y = np.sort(np.random.uniform(0, 1, N))
z = FrankeFunction(x, y)
X = create_X(x, y, n=n)
# only training data, no advanced splitting
X_train = X
Y_train = z
# only one simple layer with 100 neurons
n_hidden_neurons = 100
epochs = 100
# store models for later use
eta_vals = np.logspace(-5, 1, 7)
lmbd_vals = np.logspace(-5, 1, 7)
# store the models for later use
DNN_scikit = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object)
train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals)))
sns.set()
for i, eta in enumerate(eta_vals):
for j, lmbd in enumerate(lmbd_vals):
dnn = MLPRegressor(hidden_layer_sizes=(n_hidden_neurons), activation='logistic',
alpha=lmbd, learning_rate_init=eta, max_iter=epochs)
dnn.fit(X_train, Y_train)
DNN_scikit[i][j] = dnn
train_accuracy[i][j] = dnn.score(X_train, Y_train)
fig, ax = plt.subplots(figsize = (10, 10))
sns.heatmap(train_accuracy, annot=True, ax=ax, cmap="viridis")
ax.set_title("Training Accuracy")
ax.set_ylabel("$\eta$")
ax.set_xlabel("$\lambda$")
plt.show()