Question: Python help calc_similarity_scores(network) takes the social network as the parameter network and creates a similarity matrix for all the users in the social network. Here

Python help calc_similarity_scores(network) takes the social network as the parameter network and creates a similarity matrix for all the users in the social network. Here the definition of similarity is the number of friends that any pair of users have in common. The first thing you will want to do is initialize a list of lists that is n x n in size to all zeros that will hold the similarity (i.e., number of common friends) for each pairing of users. In other words, you will create a list of lists named similarity_matrix that will have n nested lists, each containing n zeros. (e.g., n=3 gives the following list [ [0,0,0], [0,0,0], [0,0,0] ]) def calc_similarity_scores(network): ''' 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!