title: Label Propagation in sklearn is classifying every vector as 1
body: <p>I have 2000 labelled data (7 different labels) and about 100K unlabeled data and I am trying to use <a href="http://scikit-learn.org/stable/modules/generated/sklearn.semi_supervised.LabelPropagation.html" rel="noreferrer">sklearn.semi_supervised.LabelPropagation</a>. The data has 1024 dimensions. My problem is that the classifier is labeling everything as 1. My code looks like this:</p>
  
  <pre><code>X_unlabeled = X_unlabeled[:10000, :]
  X_both = np.vstack((X_train, X_unlabeled))
  y_both = np.append(y_train, -np.ones((X_unlabeled.shape[0],)))
  clf = LabelPropagation(max_iter=100).fit(X_both, y_both)
  y_pred = clf.predict(X_test)
  </code></pre>
  
  <p><code>y_pred</code> is all ones. Also, <code>X_train</code> is 2000x1024 and <code>X_unlabeled</code> is a subset of the unlabeled data which is 10000x1024. </p>
  
  <p>I also get this error upon calling fit on the classifier:</p>
  
  <blockquote>
    <p>/usr/local/lib/python2.7/site-packages/sklearn/semi_supervised/label_propagation.py:255: RuntimeWarning: invalid value encountered in divide
      self.label_distributions_ /= normalizer</p>
  </blockquote>