title: Why is "Mae" increasing when tuning a model RFR model
body: <p>I have a problem where the Mean absolute error increases when tuning the parameters for RandomForestRegressor. I have set the scoring to <code>neg_mean_absolute_error</code> but for some reason it still increases?</p>
  
  <p>My dataset contains 100.000 observations across 300 variables where i have used a <em>train/test</em> split with a <code>test_size=0.2</code>. </p>
  
  <p>I have tried 200 combinations with randomgridsearchcv where i set <code>scoring=neg_mean_absolute_error</code>. When measuring the MAE on the test data i get a <code>mae=6500</code> (default RFR model) and on the tuned model i get an <code>mae=9000</code>. shouldn't it decrease or at least stay the same? it seems like it is underfitting the model when tuning it  </p>
  
  <p>The code I've used to tune the model looks like this:</p>
  
  <pre><code>max_features=['auto','sqrt']
  min_samples_split = [2,5,10,20,30,40]
  min_samples_leaf = [5,10,20,50,60,80]
  max_depth = [int(x) for x in np.linspace(5, 200, num = 20)]
  
  random_grid = {'max_features': max_features,
                 'max_depth': max_depth,
                 'min_samples_split': min_samples_split,
                 'min_samples_leaf': min_samples_leaf
                 }
  
  kf = KFold(n_splits=3, random_state=1)
  
  rfr=RandomForestRegressor(n_estimators=100)
  rfr_random=RandomizedSearchCV(estimator = rfr,
                                param_distributions=random_grid,
                                n_iter=200,
                                cv=kf,
                                n_jobs=-1,
                                random_state=53,
                                scoring='neg_mean_absolute_error')
  
  rfr_random.fit(x_train,y_train)
  
  RF=RandomForestRegressor(**rfr_random.best_params_)
  RF.fit(x_train,y_train)
  
  y_pred=RF.predict(x_test)
  print('Mean Absolute Error:', metrics.mean_absolute_error(y_test, y_pred)) 
  </code></pre>
  
  <p>Can anyone explain why the MAE increases when optimizing the initial model?</p>