title: Arrays used as indices must be of integer (or boolean) type
body: <p>Errors are like this:</p>
  
  <pre><code>Traceback (most recent call last):
    File "NearestCentroid.py", line 53, in &lt;module&gt;
      clf.fit(X_train.todense(),y_train)
    File "/usr/local/lib/python2.7/dist-packages/scikit_learn-0.13.1-py2.7-linux-i686.egg/sklearn/neighbors/nearest_centroid.py", line 115, in fit
      variance = np.array(np.power(X - self.centroids_[y], 2))
  IndexError: arrays used as indices must be of integer (or boolean) type
  </code></pre>
  
  <p>Codes are like this:</p>
  
  <pre><code>distancemetric=['euclidean','l2']
  for mtrc in distancemetric:
  for shrkthrshld in [None]:
  #shrkthrshld=0
  #while (shrkthrshld &lt;=1.0):
      clf = NearestCentroid(metric=mtrc,shrink_threshold=shrkthrshld)
      clf.fit(X_train.todense(),y_train)
      y_predicted = clf.predict(X_test.todense())
  </code></pre>
  
  <p>I am using <code>scikit-learn</code> package, <code>X-train</code>, <code>y_train</code> are in LIBSVM format, <code>X</code> is the feature:value pair, <code>y_train</code> is the target/label, <code>X_train</code> is in CSR matric format, the <code>shrink_threshold</code> does not support CSR sparse matrix, so I add <code>.todense()</code> to <code>X_train</code>, then I got this error, could anyone help me fix this? Thanks a lot!</p>