title: How to set own scoring with GridSearchCV from sklearn for regression?
body: <p>I used to use GridSearchCV(...scoring="accuracy"...) for classification model. and now I am about to use GridSearchCV for the regression model and set scoring with own error function.</p>
  
  <p>Example code:</p>
  
  <pre><code>def rmse(predict, actual):
      predict = np.array(predict)
      actual = np.array(actual)
  
      distance = predict - actual
  
      square_distance = distance ** 2
  
      mean_square_distance = square_distance.mean()
  
      score = np.sqrt(mean_square_distance)
  
      return score
  
  rmse_score = make_scorer(rmse)
  
  gsSVR = GridSearchCV(...scoring=rmse_score...)
  gsSVR.fit(X_train,Y_train)
  SVR_best = gsSVR.best_estimator_
  print(gsSVR.best_score_)
  </code></pre>
  
  <p>However, I found it this way return parameter set when the error score is the highest. as a result, I got the worst parameter set and score. In this case, how can I get the best estimator and score?</p>
  
  <p>summary:</p>
  
  <p>classification -> GridSearchCV(scoring="accuracy") -> best_estimaror...best</p>
  
  <p>regression -> GridSearchCV(scroing=rmse_score) -> best_estimator...worst</p>