<?xml version="1.0" encoding="utf-8"?> 
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
 <title type="text">SHRIPHANI PALAKODETY: Posts tagged 'dimensions'</title>
 <link rel="self" href="http://blog.shriphani.com/feeds/dimensions.atom.xml" />
 <link href="http://blog.shriphani.com/tags/dimensions.html" />
 <id>urn:http-blog-shriphani-com:-tags-dimensions-html</id>
 <updated>2015-01-21T02:28:09Z</updated>
 <entry>
  <title type="text">The Kernel PCA</title>
  <link rel="alternate" href="http://blog.shriphani.com/2015/01/20/the-kernel-pca/?utm_source=dimensions&amp;utm_medium=Atom" />
  <id>urn:http-blog-shriphani-com:-2015-01-20-the-kernel-pca</id>
  <published>2015-01-21T02:28:09Z</published>
  <updated>2015-01-21T02:28:09Z</updated>
  <author>
   <name>SHRIPHANI PALAKODETY</name></author>
  <content type="html">&lt;html&gt;
&lt;p&gt;The Kernel PCA is an extension of the PCA algorithm. In particular, we desire to (i) transform our existing dataset to another high-dimensional space and then (ii) perform PCA on the data in that space.&lt;/p&gt;

&lt;p&gt;In this blog post, I will perform a very quick, non-rigorous overview of Kernel PCA and demonstrate some connections between other forms of dimension-reduction.&lt;/p&gt;

&lt;p&gt;Why would this be useful? Consider this dataset (stolen from the scikit-learn documentation):&lt;/p&gt;

&lt;p&gt;&lt;img src="http://scikit-learn.org/stable/_images/plot_kernel_pca_001.png" /&gt;&lt;/p&gt;

&lt;p&gt;As we can see, the original PCA projection is fairly useless. Applying a kernel produces a much better projection.&lt;/p&gt;

&lt;p&gt;Like kernels in several problems, the trick is to avoid transforming data-points and leveraging dot-products.&lt;/p&gt;

&lt;p&gt;The technique is as follows:&lt;/p&gt;

&lt;p&gt;$ \Phi $ is a mapping from our existing point-space to a higher-dimensional space $ \mathcal{F} $.&lt;/p&gt;

&lt;p&gt;After a certain amount of linear algebra, the PCA in space $ \mathcal{F} $ can be expressed as a PCA on the &lt;a href="http://en.wikipedia.org/wiki/Kernel_method"&gt;kernel matrix&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, the algorithm is expressible as follows:&lt;/p&gt;

&lt;ul&gt;
 &lt;li&gt;
  &lt;p&gt;Compute the kernel matrix $ K $ where $ K_{ij} = \Phi(x_i) \cdot \Phi(x_j) $.&lt;/p&gt;&lt;/li&gt;
 &lt;li&gt;
  &lt;p&gt;This matrix is efficiently constructed since we can obtain the  constituent dot products in the original space.&lt;/p&gt;&lt;/li&gt;
 &lt;li&gt;
  &lt;p&gt;The SVD of $ K $ gives you $ USV^{T} $ - $ U $ and $ S $ can be used  to construct a reduced dimension dataset.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;Now that the intro is out of the way, I wanted to demonstrate some simple connections between algorithms I&amp;rsquo;ve covered recently:&lt;/p&gt;

&lt;h3 id="mds-with-euclidean-distances"&gt;MDS with Euclidean Distances&lt;/h3&gt;

&lt;p&gt;In &lt;a href="http://blog.shriphani.com/2015/01/15/multidimensional-scaling-and-pca-are-the-same-thing/"&gt;previous blog posts&lt;/a&gt;, we covered that MDS and PCA are equivalent. A simple proof exists to show that MDS and Kernel PCA are the same thing:&lt;/p&gt;

&lt;ul&gt;
 &lt;li&gt;The proximity matrix in the MDS algorithm is built with  distances. We can express distances between vectors $ x $ and $ y $ as:&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt; 
 &lt;div&gt;$$ d(x,y) = x \cdot x + y \cdot y &amp;ndash; 2x \cdot y $$&lt;/div&gt;&lt;/p&gt;

&lt;ul&gt;
 &lt;li&gt;Thus, distances can be expressed as a kernel. The upshot of this is  that the MDS algorithm itself is an instance of Kernel PCA.&lt;/li&gt;&lt;/ul&gt;

&lt;h3 id="isomap"&gt;Isomap&lt;/h3&gt;

&lt;p&gt;The Isomap algorithm (covered in a &lt;a href="http://blog.shriphani.com/2014/11/12/the-isomap-algorithm/"&gt;previous post&lt;/a&gt;) trades the Euclidean distance with edge weights in a nearest neighbor graph. The entries in this proximity matrix are surrogates for distances and thus the Isomap algorithm is an instance of Kernel PCA as well.&lt;/p&gt;

&lt;p&gt;It is amazing how several different approaches to dimension-reduction are variants of a single theme.&lt;/p&gt;&lt;/html&gt;</content></entry></feed>