Question: Python help recommend(user_id,network,similarity_matrix) This user_id will be used as an index into the similarity_matrix which will give you access to the list of similarity scores

Python help recommend(user_id,network,similarity_matrix) This user_id will be used as an index into the similarity_matrix which will give you access to the list of similarity scores for that given user (user_id) for all other users. You should then determine the largest value in this list and return its index as the most similar. Of course, you dont want to recommend someone who is already a friend and it also doesnt make sense to recommend the person as his or her own friend. It is the most similar because by having the largest value in the list it means that it is the user who had the most friends in common with user_id. (Hint: while developing this function using the small network file I printed out similarity_matrix[user_id] and network[user_id] so I could check that the correct recommendation was calculated.) def recommend(user_id,network,similarity_matrix): ''' Remember the docstring''' pass # this is a placeholder that you will replace with Python code 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!