Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scissors - Lindsey #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Scissors - Lindsey #66

wants to merge 2 commits into from

Conversation

lileekoi
Copy link

No description provided.

ls
quit
quit()
''
def get_watched_avg_rating(user_data):
avg_rating = 0.0
for movie in user_data["watched"]:
avg_rating = (movie["rating"])/len(user_data["watched"]) + avg_rating

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a neat way to generate the average!

As an aside, another way to write this line is:
avg_rating += (movie["rating")/len(user_data["watched"])

# print(user_data["watched"])

watched = user_data["watched"]
genre_freq_dict = calculate_genre_freq(watched)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great use of a helper function!



def get_friends_unique_watched(user_data):
unique_movie = []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability I recommend naming variables to reflect their contents - in this case this is a list of unique movies, so I would name it unique_movies or unique_movie_list

Comment on lines +120 to +129
def get_new_rec_by_genre(user_data):
most_watched_genre = get_most_watched_genre(user_data)
print(most_watched_genre)
new_genre_recs = []
for friend in user_data["friends"]:
for movie in friend["watched"]:
if movie["genre"] == most_watched_genre and movie not in user_data["watched"]:
new_genre_recs.append(movie)

return new_genre_recs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use the function get_friends_unique_watched in this function? Also, this will pass the tests as written, but what if two friends have watched the same movie that fits the criteria (it's not in the user's watched list & it's the most watched genre)? Currently this will repeat the recommendation rather than giving only unique recommendations.

@jbieniosek
Copy link

Great job! You hit the learning goals here. Overall, this was a fantastic first project, you should be proud! I left a few minor comments in the code, we will go over those at our 1:1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants