Logic.core.link_analysis package#
Logic.core.link_analysis.analyzer module#
- class LinkAnalyzer(root_set)#
Bases:
object
- expand_graph(corpus)#
expand hubs, authorities and graph using given corpus
- Parameters:
corpus (list) – A list of movie dictionaries with the following keys: “id”: A unique ID for the movie “stars”: A list of movie star names
Note
To build the base set, we need to add the hubs and authorities that are inside the corpus and refer to the nodes in the root set to the graph and to the list of hubs and authorities.
- hits(num_iteration=5, max_result=10)#
Return the top movies and actors using the Hits algorithm
- Parameters:
- Returns:
list – List of names of 10 actors with the most scores obtained by Hits algorithm in descending order
list – List of names of 10 movies with the most scores obtained by Hits algorithm in descending order
- initiate_params()#
Initialize links graph, hubs list and authorities list based of root set
- Parameters:
attributes (This function has no parameters. You can use self to get or change)