Smol tweaks

This commit is contained in:
Dominik Moritz Roth 2021-09-24 17:23:34 +02:00
parent 292951c50c
commit 1521f20340

View File

@ -509,7 +509,7 @@ def addScoreToLabels(G):
node['label'] += " ("+str(node['rating'])+")"
else:
if 'score' in node and node['score'] != None:
node['label'] += " (~{:.2f}±{:.2f})".format(node['score'], node['std'])
node['label'] += " (~{:.2f}±{:.1f})".format(node['score'], node['std'])
else:
node['label'] += " (~0±∞)"
@ -545,26 +545,27 @@ def genScores(G, books):
def recommendNBooks(G, mu, std, n, removeTopListsB=True, removeUselessRecommenders=True):
removeRestOfSeries(G)
removeBad(G, mu-std*2-1)
removeKeepBest(G, int(n*2) + 5, maxDistForRead=1.5*2)
removeKeepBest(G, int(n*2) + 5, maxDistForRead=2)
removeEdge(G)
removeHighSpanTags(G, 9)
removeDangling(G, alsoBooks=False)
pruneTags(G, 6*2)
pruneTags(G, 10)
removeBad(G, mu, groups=['book'])
removeUselessReadBooks(G)
pruneTags(G, 4.25*2)
pruneTags(G, 6)
pruneRecommenderCons(G, int(n/7)+1)
pruneAuthorCons(G, int(n/15))
removeUselessTags(G)
if removeTopListsB:
removeTopLists(G)
removeDangling(G, alsoBooks=True)
removeKeepBest(G, n, maxDistForRead=0.75*2)
removeKeepBest(G, n+math.ceil(n/20), maxDistForRead=1.5)
removeEdge(G)
removeDangling(G, alsoBooks=True)
if removeUselessRecommenders:
removeUnusedRecommenders(G)
removeDangling(G, alsoBooks=True)
removeKeepBest(G, n, maxDistForRead=1.25)
scaleBooksByRating(G)
scaleOpinionsByRating(G)