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
+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 --------------- -->