GridSearchCV: How to specify test set?
<p>I have a question regarding <code>GridSearchCV</code>:</p>

<p>by using this:</p>

<pre><code>gs_clf = GridSearchCV(pipeline, parameters, n_jobs=-1, cv=6, scoring="f1")
</code></pre>

<p>I specify that k-fold cross-validation should be used with 6 folds right?</p>

<p>So that means that my corpus is split into training set and tet set 6 times.</p>

<p>Doesn't that mean that for the <code>GridSearchCV</code> I need to use my entire corpus, like so:</p>

<pre><code>gs_clf = gs_clf.fit(corpus.data, corpus.target)
</code></pre>

<p>And if so, how would I then get my trainig set from there used for the predict method?</p>

<pre><code>predictions = gs_clf.predict(??)
</code></pre>

<p>I have seen code where the corpus is split into test set and training set using <code>train_test_split</code> and then <code>X_train</code> and <code>Y_train</code> are passed to <code>gs_clf.fit</code>.</p>

<p>But that doesn't make sense to me: If I split it the corpus beforehand, why use cross validation again in the <code>GridSearchCV</code>?</p>

<p>Thanks for some clarification!!</p>