I am trying out hyperparameter tuning vs manually selecting best parameter (max_leaf_nodes) on a Decision Tree model with mean absolute error as scoring. In theory both should give me the same mae and max_leaf_nodes. But both are giving me different mae. Also if I change the value of cv in GridSearchCV I get different results. So basically I have two questions: 1.) Why am I getting different Max_leaf_nodes and mae in both the cases? 2.) How do I determine the value of cv in GridsearchCV because I get different results for cv = 3, cv = 5 and cv = 10.

The "for" file attached is where I manually set the max_leaf_node parameter and the "grid" file is where I use GridSearchCV(). Both give me different results!!

Similar questions and discussions