How to get ordered list of labels after fitting sklearn
<pre><code>train_index, test_index = next(iter(ShuffleSplit(821, train_size=0.2, test_size=0.80, random_state=42)))
print train_index, len(train_index)
print test_index, len(test_index)

features_train, features_test, labels_train, labels_test = cross_validation.train_test_split(features, labels, train_size=0.33, random_state=42)

clf = DecisionTreeClassifier()
clf.fit(features_train, labels_train)
pred = clf.predict(features_test, labels_test)
print pred, len(pred)
</code></pre>

<p>A few questions from this code:</p>

<ol>
<li>Why do I need the cross_validation.train_test_split line in order to fit and predict with my classifier? (I am not doing any preprocessing on my data except for stopword removal I have already done)</li>
<li>Do the test and train indexes correspond to the classified &amp; predicted labels? My goal is to get <strong>all</strong> my labels, in their original order, after fitting and predicting them. My features and labels used for training and testing are from a pandas dataframe (two columns), and I need the predicted labels, in order, so that I can feed them back into the pandas dataframe.</li>
<li>Is there a way to predict the labels for the whole set, and not just the test set? </li>
</ol>