title: Parameters used in GridSearchCV Slow Down in skLearn Tutorial
body: <p><strong>I'm not sure why <code>grid.fit(X,y)</code> is correct, rather than <code>grid.fit(X_2d, y_2d)</code></strong></p>
  
  <p>In this tutorial on <a href="https://scikit-learn.org/stable/auto_examples/svm/plot_rbf_parameters.html" rel="nofollow noreferrer">RBF SVM Parameters</a>, we are using <code>GridSearchCV</code> to find the optimum hyperparameters for an SVM.</p>
  
  <p>They have the following code:</p>
  
  <pre><code># Dataset for decision function visualization: we only keep the first 
  two
  # features in X and sub-sample the dataset to keep only 2 classes and
  # make it a binary classification problem.
  
  X_2d = X[:, :2]
  X_2d = X_2d[y &gt; 0]
  y_2d = y[y &gt; 0]
  y_2d -= 1
  </code></pre>
  
  <p>...</p>
  
  <pre><code>param_grid = dict(gamma=gamma_range, C=C_range)
  
  # GridSearchCV will search the parameter space for the best parameters to use, minimizing the score function
  cv = StratifiedShuffleSplit(n_splits=5, test_size=0.2, random_state=42)
  
  grid = GridSearchCV(SVC(), param_grid=param_grid, cv=cv)
  
  # ==================== CODE I'M INTERESTED IN  ==================&gt;
  # ===== SWITCH `grid.fit(X,y)` with grid.fit(X_2d, y_2d) ========&gt;
  grid.fit(X, y)
  # ==================== ^^^^^^^^^^^^^^^^^^^  =============&gt;
  
  print("The best parameters are %s with a score of %0.2f"
        % (grid.best_params_, grid.best_score_))
  </code></pre>
  
  <p>where <code>X_2d</code> and <code>y_2d</code> are a subset of <code>X</code> and <code>y</code>.</p>
  
  <hr>
  
  <p><strong>Just some information to show what <code>X</code> and <code>y</code> are:</strong></p>
  
  <pre><code>print(X.shape)    #(150,4)
  print(y.shape)    #(150,)
  print(X_2d.shape) #(100,2)
  print(y_2d.shape) #(100,)
  print(type(X))    #&lt;class 'numpy.ndarray'&gt;
  print(type(y))    #&lt;class 'numpy.ndarray'&gt;
  print(type(X_2d)) #&lt;class 'numpy.ndarray'&gt;
  print(type(y_2d)) #&lt;class 'numpy.ndarray'&gt;
  </code></pre>
  
  <p>Why does changing the code above to <code>grid.fit(X_2d, y_2d)</code> not work? I'm not sure if it's taking a very long time, OR that it's incorrect. My Jupyter Notebook is just sitting, whereas <code>grid.fit(X, y)</code> only takes seconds.</p>
  
  <p>My original thought was that we would want to fit to the actual data set we're running on which are <code>X_2d</code> and <code>y_2d</code>, rather than <code>X</code> and <code>y</code></p>