src/graph.py
def __weight(self, node1, node2):
        '''
        Calculates 1 - jaccard similarity between two nodes.
        The jaccard similarity is calculated as the number of publications in common
        divided by the number of total publications between two authors.
        Args
            node1: A node from a NetworkX graph
            node2: A node from a NetworkX graph
        Returns:
            1 - jaccard similarity between node1 and node2
        '''
        pubs1 = set(node1['publications'].keys())
        pubs2 = set(node2['publications'].keys())
        weight = 1 - (len(pubs1.intersection(pubs2))/len(pubs1.union(pubs2)))
        return weight

        Calculates 1 - jaccard similarity between two nodes.
        The jaccard similarity is calculated as the number of publications in common
        divided by the number of total publications between two authors.
        Args
            node1: A node from a NetworkX graph
            node2: A node from a NetworkX graph
        Returns:
            1 - jaccard similarity between node1 and node2
        
Calculates 1 - jaccard similarity between two nodes.
The jaccard similarity is calculated as the number of publications in common
divided by the number of total publications between two authors.
Args
node1: A node from a NetworkX graph
node2: A node from a NetworkX graph
Calculates 1 - jaccard similarity between two nodes . The jaccard similarity is calculated as the number of publications in common divided by the number of total publications between two authors . Args node1 : A node from a NetworkX graph node2 : A node from a NetworkX graph
def __weight(self, node1, node2):
        pubs1 = set(node1['publications'].keys())
        pubs2 = set(node2['publications'].keys())
        weight = 1 - (len(pubs1.intersection(pubs2))/len(pubs1.union(pubs2)))
        return weight
def __weight ( self , node1 , node2 ) : pubs1 = set ( node1 [ 'publications' ] . keys ( ) ) pubs2 = set ( node2 [ 'publications' ] . keys ( ) ) weight = 1 - ( len ( pubs1 . intersection ( pubs2 ) ) / len ( pubs1 . union ( pubs2 ) ) ) return weight
Calculates 1 - jaccard similarity between two nodes.
Calculates 1 - jaccard similarity between two nodes .
'''
        Calculates 1 - jaccard similarity between two nodes.
        The jaccard similarity is calculated as the number of publications in common
        divided by the number of total publications between two authors.
        Args
            node1: A node from a NetworkX graph
            node2: A node from a NetworkX graph
        Returns:
            1 - jaccard similarity between node1 and node2
        '''
jaccard similarity between node1 and node2
jaccard similarity between node1 and node2
self
node1
node2