Advertisement
897bhgy

Untitled

Jul 24th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | Source Code | 0 0
  1. from surprise import SVD
  2. from surprise import Dataset
  3. from surprise.model_selection import cross_validate
  4.  
  5. # Load the movielens-100k dataset
  6. data = Dataset.load_builtin('ml-100k')
  7.  
  8. # Use the famous SVD algorithm
  9. algo = SVD()
  10.  
  11. # Run 5-fold cross-validation and print results
  12. cross_validate(algo, data, measures=['RMSE', 'MAE'], cv=5, verbose=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement