Added a progress-command (and newly trained weights)

This commit is contained in:
Dominik Moritz Roth 2021-11-24 22:35:39 +01:00
parent ef7fceacea
commit f2fad859dc
2 changed files with 26 additions and 1 deletions

View File

@ -718,6 +718,25 @@ def readBooksAnalysis(G, minRating=0, showAllTags=True, removeUnconnected=False,
scaleOpinionsByRating(G)
addScoreToLabels(G)
def progress(G, minimum=3.5):
bookCount = 0
readCount = 0
toReadCount = 0
for n in list(G.nodes):
node = G.nodes[n]
if node['t'] == 'book':
bookCount += 1
if node['rating'] != None:
readCount += 1
elif 'score' in node and (node['score'] >= minimum or node['std']==0.0):
toReadCount += 1
perc = round(readCount / (toReadCount+readCount) * 100, 2)
print('Books in libary: '+str(bookCount))
print('Read Books: '+str(readCount))
print('Unread Books: '+str(bookCount-readCount))
print('Recommended Books (score > '+str(round(minimum, 2))+'): '+str(toReadCount))
print('Progress: '+str(perc)+'%')
def analyze(G, type_name, name, dist=2.7):
from fuzzywuzzy import fuzz
@ -935,6 +954,9 @@ def cliInterface():
p_train.add_argument('-g', type=float, default=0.1, help='learning rate gamma')
p_train.add_argument('--full', action="store_true")
p_prog = cmds.add_parser('progress', description="TODO", aliases=[])
p_prog.add_argument('-m', type=float, default=7, help='Mimimum Score to read')
p_full = cmds.add_parser('full', description="TODO", aliases=[])
args = parser.parse_args()
@ -966,6 +988,9 @@ def cliInterface():
analyze(G, args.type, args.name, args.d)
elif args.cmd=="full":
fullGraph(G, not args.keep_top_lists)
elif args.cmd=="progress":
progress(G, args.m)
return
else:
raise Exception("Bad")

View File

@ -1 +1 @@
{"topList": 0.46904994817058576, "recommender": 0.5105580165380674, "author": 1.2017599208712688, "series": 0.08101540889409455, "tag": 0.01759005368430446, "mu": 0.6921620983533125, "sigma": 0.016831028550919676, "se": 0.3363180764359938, "bias": 0.15960517748561318}
{"topList": 0.45743192655139997, "recommender": 0.5079140172269819, "author": 1.2111137699117849, "series": 0.06399278731591332, "tag": 0.015332649025594572, "mu": 0.7090073197262562, "sigma": 0.015801805052114225, "se": 0.338754954784782, "bias": 0.16354975767988336}