diff --git a/caliGraph.py b/caliGraph.py index ef70d1c..701a509 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -994,7 +994,7 @@ def findNewBooks(G, books, num, minRecSco=5): recs.append({'name': node['label'], 'rec': node, 'newBooks': newBooks, 'oldBooks': oldBooks}) for rec in recs: for book in rec['newBooks']: - G.add_node('n/'+book['title'], color='blue', t='newBook', label=book['title']) + G.add_node('n/'+book['title'], color='blue', t='newBook', label=book['title'], author=book['author']) G.add_node('r/'+rec['rec']['label'], color='orange', t='recommender', label=rec['rec']['label'], score=rec['rec']['score']) G.add_edge('r/'+rec['rec']['label'], 'n/'+book['title'], color='blue') @@ -1019,6 +1019,7 @@ def findNewBooks(G, books, num, minRecSco=5): node['score'] = sum(scores)/len(scores)*1.2 - node['fake_se']*2.5 + 0.5 - 0.1/math.sqrt(len(scores)) node['value'] = 20 + 5 * float(node['score']) node['label'] += " ({:.2f}±{:.1f})".format(node['score'], node['fake_se']) + node['label'] += '\n ' + node['author'] removeKeepBest(G, num, 10, 'newBook') # while batchSize is implemented, we only get a good gonvergence when we disable it (batchSize=-1)