title: How to customize sklearn cross validation iterator by indices?
body: <p>Similar to <a href="https://stackoverflow.com/questions/24078301/custom-cross-validation-split-sklearn">Custom cross validation split sklearn</a> I want to define my own splits for GridSearchCV for which I need to customize the built in cross-validation iterator. </p>
  
  <p>I want to pass my own set of train-test indices for cross validation to the GridSearch instead of allowing the iterator to determine them for me. I went through the available cv iterators on the sklearn documentation page but couldn't find it.</p>
  
  <p>For example I want to implement something like this
  Data has 9 samples
  For 2 fold cv I create my own set of training-testing indices</p>
  
  <pre><code>&gt;&gt;&gt; train_indices = [[1,3,5,7,9],[2,4,6,8]]
  &gt;&gt;&gt; test_indices = [[2,4,6,8],[1,3,5,7,9]]
                   1st fold^    2nd fold^
  &gt;&gt;&gt; custom_cv = sklearn.cross_validation.customcv(train_indices,test_indices)
  &gt;&gt;&gt; clf = GridSearchCV(X,y,params,cv=custom_cv)
  </code></pre>
  
  <p>What can be used to work like customcv?</p>