title: Cross validation and model selection
body: <p>I am using <code>sklearn</code> for SVM training. I am using the cross-validation to evaluate the estimator and avoid the overfitting model.</p>
  <p>I split the data into two parts. Train data and test data. Here is the code:</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  from sklearn import cross_validation
  from sklearn import datasets
  from sklearn import svm
  
  X_train, X_test, y_train, y_test = cross_validation.train_test_split(
      iris.data, iris.target, test_size=0.4, random_state=0
  )
  clf = svm.SVC(kernel='linear', C=1)
  scores = cross_validation.cross_val_score(clf, X_train, y_train, cv=5)
  print scores
  </code></pre>
  <p>Now I need to evaluate the estimator <em>clf</em> on X_test.</p>
  <pre><code>clf.score(X_test, y_test)
  </code></pre>
  <p>here,  I get an error saying that <em>the model is not fitted using fit()</em>, but normally, in <code>cross_val_score</code> function the model is fitted? What is the problem?</p>