Randomforest parameter tuning R(caret) and Python(scikit learn)?
I guess what you are looking for is sklearn.model_selection.GridSearchCV() or a similar function regarding the type of &quot;search&quot; (grid, random, ...) you would like to conduct. This function does hyperparameter tuning and uses cross validation when doing so and the cv parameter will allow you to specify the number of folds.