(self, projection='scaled', includeSubPaths=True)
return v
Calculates the eigenvector centralities of higher-order nodes. If 
        the order of the HigherOrderNetwork is larger than one, the centralities
        will be projected to the first-order nodes. 

        @param projection: Indicates how the projection from k-th-order nodes (v1, v2, ... , v{k-1})
            shall be performed. For the method 'all', the eigenvector centrality of the higher-order node 
            will be added to *all* first-order nodes on the path corresponding to the higher-order node. For 
            the method 'last', the centrality of the higher-order node will only be assigned to *last* 
            first-order node v{k-1}. For the method 'scaled' (default), the eigenvector centrality of higher-order 
            nodes will be assigned proportionally to first-order nodes, i.e. each of the three nodes in the 
            third-order node (a,b,c) will receive one third of the eigenvector centrality of (a,b,c).
        @param includeSubPaths: whether or not to include subpath statistics in the calculation (default True)
Calculates the eigenvector centralities of higher-order nodes. If 
        the order of the HigherOrderNetwork is larger than one, the centralities
        will be projected to the first-order nodes.
Calculates the eigenvector centralities of higher - order nodes . If the order of the HigherOrderNetwork is larger than one the centralities will be projected to the first - order nodes .
def EvCent(self, projection='scaled', includeSubPaths=True):
        """
        Calculates the eigenvector centralities of higher-order nodes. If 
        the order of the HigherOrderNetwork is larger than one, the centralities
        will be projected to the first-order nodes. 

        @param projection: Indicates how the projection from k-th-order nodes (v1, v2, ... , v{k-1})
            shall be performed. For the method 'all', the eigenvector centrality of the higher-order node 
            will be added to *all* first-order nodes on the path corresponding to the higher-order node. For 
            the method 'last', the centrality of the higher-order node will only be assigned to *last* 
            first-order node v{k-1}. For the method 'scaled' (default), the eigenvector centrality of higher-order 
            nodes will be assigned proportionally to first-order nodes, i.e. each of the three nodes in the 
            third-order node (a,b,c) will receive one third of the eigenvector centrality of (a,b,c).
        @param includeSubPaths: whether or not to include subpath statistics in the calculation (default True)
        """
        A = self.getAdjacencyMatrix(includeSubPaths=includeSubPaths, weighted=False, transposed=True)

        # calculate leading eigenvector of A
        w, v = _sla.eigs(A, k=1, which="LM", ncv=13 )
        
        v = v.reshape(v.size,)
       
        higher_order_evcent = dict(zip(self.nodes, map(_np.abs, v)))

        # project evcent of higher-order nodes to first-order network
        first_order_evcent = _co.defaultdict( lambda: 0.0 )

        # sum evcent values based on higher-order nodes 
        # and normalize the result
        for v in self.nodes:
            # turns node a-b-c in path tuple (a,b,c)
            p = self.HigherOrderNodeToPath(v)
            if projection == 'all':
                # assign evcent of higher-order node to all first-order nodes
                for x in p:                    
                    first_order_evcent[x] += higher_order_evcent[v]
            elif projection == 'scaled':
                for x in p:                    
                    first_order_evcent[x] += higher_order_evcent[v] / float( len(p) )
            elif projection == 'last':
                # assign evcent of higher-order node to last first-order node
                first_order_evcent[p[-1]] += higher_order_evcent[v]
            elif projection == 'first':
                # assign evcent of higher-order node to last first-order node
                first_order_evcent[p[0]] += higher_order_evcent[v]

        # for scaled, values sum to one anyway
        if projection != 'scaled':
            for v in first_order_evcent:
                first_order_evcent[v] /= sum(first_order_evcent.values())

        Log.add('finished.', Severity.INFO)

        return first_order_evcent

        return v
def EvCent ( self , projection = 'scaled' , includeSubPaths = True ) : A = self . getAdjacencyMatrix ( includeSubPaths = includeSubPaths , weighted = False , transposed = True ) # calculate leading eigenvector of A w , v = _sla . eigs ( A , k = 1 , which = "LM" , ncv = 13 ) v = v . reshape ( v . size , ) higher_order_evcent = dict ( zip ( self . nodes , map ( _np . abs , v ) ) ) # project evcent of higher-order nodes to first-order network first_order_evcent = _co . defaultdict ( lambda : 0.0 ) # sum evcent values based on higher-order nodes  # and normalize the result for v in self . nodes : # turns node a-b-c in path tuple (a,b,c) p = self . HigherOrderNodeToPath ( v ) if projection == 'all' : # assign evcent of higher-order node to all first-order nodes for x in p : first_order_evcent [ x ] += higher_order_evcent [ v ] elif projection == 'scaled' : for x in p : first_order_evcent [ x ] += higher_order_evcent [ v ] / float ( len ( p ) ) elif projection == 'last' : # assign evcent of higher-order node to last first-order node first_order_evcent [ p [ - 1 ] ] += higher_order_evcent [ v ] elif projection == 'first' : # assign evcent of higher-order node to last first-order node first_order_evcent [ p [ 0 ] ] += higher_order_evcent [ v ] # for scaled, values sum to one anyway if projection != 'scaled' : for v in first_order_evcent : first_order_evcent [ v ] /= sum ( first_order_evcent . values ( ) ) Log . add ( 'finished.' , Severity . INFO ) return first_order_evcent return v