XGBRegressor hyperparameter optimization using xgb cv function
It seems to be complaining about the folds.split part, indicating that folds is an integer.  If your cv_folds object is just the number of folds, pass that as nfolds instead; folds expects the actual sklearn KFold object rather than a number.