the code s from a recommendation engine using surprise module, i can't find the answer anywhere.
Depending on what you objective is, you can use the cross_validation
method and it will perform the splits automatically for you. Example: cross_validate(algorithm_to_use, data, measures=['RMSE'], cv=5)...
The cv=5
tells the cross validation iterator how to split the data.
See documentation on Cross validation.
You can also explore the model selection package for what you need.
Context is important when trying to help you find a solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With