diff --git a/python-recipes/recommendation-systems/01_collaborative_filtering.ipynb b/python-recipes/recommendation-systems/01_collaborative_filtering.ipynb index 84165cb..e1abfc6 100644 --- a/python-recipes/recommendation-systems/01_collaborative_filtering.ipynb +++ b/python-recipes/recommendation-systems/01_collaborative_filtering.ipynb @@ -251,7 +251,7 @@ ], "source": [ "# split the data into training and testing sets (80% train, 20% test)\n", - "train_set, test_set = train_test_split(ratings_data, test_size=0.2)\n", + "train_set, test_set = train_test_split(ratings_data, test_size=0.2, random_state=42)\n", "\n", "# use SVD (Singular Value Decomposition) for collaborative filtering\n", "svd = SVD(n_factors=100, biased=False) # we'll set biased to False so that predictions are of the form \"rating_prediction = user_vector dot item_vector\"\n",