Better error-message on pagerank ev-iter fail
This commit is contained in:
parent
3c0f1b18b4
commit
6e64e76310
@ -483,7 +483,8 @@ def runPagerank(G):
|
||||
try:
|
||||
scores = nx.pagerank(G=G)
|
||||
except nx.exception.PowerIterationFailedConvergence:
|
||||
print('[!] Could not calculate pagerank-scores: power iteration of the eigenvector calculation did not converge')
|
||||
print('[!] Could not calculate pagerank-scores: Power iteration of the eigenvector calculation did not converge')
|
||||
print('[ ] Recommendations will be of slighly lower quality')
|
||||
scores = {}
|
||||
for n in list(G.nodes):
|
||||
G.nodes[n]['pagerank_score'] = scores[n] if n in scores else 0
|
||||
|
Loading…
Reference in New Issue
Block a user