From the course: Building Recommender Systems with Machine Learning and AI

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Exercise solution: Random exploration

Exercise solution: Random exploration

- [Instructor] Hopefully you managed to get that running, but if you're new to Python, it may have been a little bit challenging. If you'd like to look at my solution, open up Spyder and close out everything you no longer want to look at with Control + Shift + W. Now open up everything in the Challenges folder of the course materials. Select the EvaluateUserCF-Exploration file. There are only a few changes here. First, we're importing MovieLens2 instead of MovieLens, which is my modified movie lens module that we'll look at shortly. It's been modified to identify movies from the most recent year. If we skip down to line 41, we can see that where I'm retrieving that list of new movies and defining which slot in my top 10 recommendations will be used to surface those new movies at random. Skipping down to line 78, this is where we are constructing the top 10 recommendations for each user. If we're in the final slot we defined, we choose one of those new movies at random. Otherwise, we…

Contents