I am trying out hyperparameter tuning vs manually selecting the best parameter (max_leaf_nodes
) on a decision tree model with mean absolute error as the scoring. In theory, both should give me the same MAE and max_leaf_nodes
; but, both are giving me different MAEs. Also, if I change the value of cv in GridSearchCV I get different results. So basically I have two questions:
Why am I getting different
max_leaf_nodes
and MAE in both cases?How do I determine the value of cv in GridsearchCV, because I get different results for cv = 3, cv = 5, and cv = 10?
GridSearchCV
, see also this stackexchange answer. $\endgroup$