title: running the model by the def function
body: <p>I have a set of 3 gredi estimators that call them that way, but I don't like them and I would like to call them through loops. But my function doesn't work.</p>
  <pre><code>from sklearn.model_selection import GridSearchCV
  
  
  ##==============================================================================
  
  RFC1 = GridSearchCV(estimator=RFC,
                        param_grid = params_RFC1,
                        cv=cv_method,
                        verbose=1,
                        scoring = 'roc_auc') 
  
  ##==============================================================================
  
  RFC2 = GridSearchCV(estimator=RFC,
                        param_grid = params_RFC2,
                        cv=cv_method,
                        verbose=1,
                        scoring = 'roc_auc') 
  ##==============================================================================
  
  RFC3 = GridSearchCV(estimator=RFC,
                        param_grid = params_RFC3,
                        cv=cv_method,
                        verbose=1,
                        scoring = 'roc_auc') 
  ##==============================================================================
  </code></pre>
  <p>Where I make a mistake and I don't know where</p>
  <pre><code>from sklearn.model_selection import GridSearchCV
  
  global model
  
  def model(estimator,param_grid,model):
      model = GridSearchCV(estimator=estimator,
                        param_grid = params,
                        cv=cv_method,
                        verbose=1,
                        scoring = 'roc_auc') 
      return model
  </code></pre>