<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0">
 <channel>
  <title>SHRIPHANI PALAKODETY: Posts tagged 'k-nn-classifier'</title>
  <description>SHRIPHANI PALAKODETY: Posts tagged 'k-nn-classifier'</description>
  <link>http://blog.shriphani.com/tags/k-nn-classifier.html</link>
  <lastBuildDate>Sat, 30 Nov 2013 04:49:33 UT</lastBuildDate>
  <pubDate>Sat, 30 Nov 2013 04:49:33 UT</pubDate>
  <ttl>1800</ttl>
  <item>
   <title>A Comment on Dimension-Estimation</title>
   <link>http://blog.shriphani.com/2013/11/29/a-comment-on-dimension-estimation/?utm_source=k-nn-classifier&amp;utm_medium=RSS</link>
   <guid>urn:http-blog-shriphani-com:-2013-11-29-a-comment-on-dimension-estimation</guid>
   <pubDate>Sat, 30 Nov 2013 04:49:33 UT</pubDate>
   <description>&lt;html&gt;
&lt;p&gt;I saw this neat comment in a paper I was recently reading. If you have all &lt;code&gt;i.i.d&lt;/code&gt; features and you want to estimate its dimension using Grassberger-Procaccia (which estimates dimension using a distance-based metric) or want to classify using a k-NN classifier, it is bad if the data points are mostly pairwise equidistant (for instance, a correlation integral plot will look like a step function and thus will be useless; a k-NN classifier will break because the test point ends up equidistant from all the existing points).&lt;/p&gt;

&lt;p&gt;There is a trivial argument using the Hoeffding bound in Chris Burges&amp;rsquo; &lt;a href="http://research.microsoft.com/en-us/um/people/cburges/tech_reports/msr-tr-2009-2013.pdf"&gt;paper&lt;/a&gt; that suggests that if the features are all &lt;code&gt;i.i.d&lt;/code&gt;, a majority of pairwise distances will end up clustered tightly around a mean which means that k-NN or Grassberger-Procaccia won&amp;rsquo;t work well. I am going to repeat this argument here so I can remember it for later:&lt;/p&gt;

&lt;p&gt;Our vectors are of dimension $ d $ and the components are $ \pm1 $. Assuming all the components are $ iid $, the Hoeffding bound gives us:&lt;/p&gt;

&lt;p&gt;$$ P(||| x_{1} - x_{2} ||^{2} &amp;ndash; 2d| &amp;gt; d\epsilon) = P(| x_{1} \cdot x_{2} | &amp;gt; d\epsilon/2) \le 2exp(-\frac{d\epsilon^2}{8})$$&lt;/p&gt;

&lt;p&gt;and this shows us that most pairwise distances will end up clustered very tightly around a mean and this means that a majority of pairs of points in the dataset will end up equidistant and thus a $ k-NN $ classifier will fail.&lt;/p&gt;

&lt;p&gt;This also means that the correlation integral is a good way to determine if a k-NN classifier will work well. If the plot resembles a spike, the distance function needs to change.&lt;/p&gt;

&lt;p&gt;The correlation-integral is an immensely powerful tool and &lt;a href="https://github.com/shriphani/clj-dimension/blob/master/src/clj_dimension/estimation/correlation_integral.clj"&gt;here&amp;rsquo;s&lt;/a&gt; an implementation&lt;/p&gt;&lt;/html&gt;</description></item></channel></rss>