From be0afb59c718a917eeae9c252ee120fe0ff9f3d3 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 4 Jul 2021 20:08:25 +0200 Subject: [PATCH] Fined tuned wheight of TopLists and Tags --- caliGraph.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/caliGraph.py b/caliGraph.py index 5ca158f..6111a8f 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -86,7 +86,7 @@ def getTopListWheight(book, topList): minScope = min(minScope, scope) if minScope == 100000: raise Exception("You stupid?") - return 100/minScope + return minScope / 10 def removeRead(G): @@ -287,6 +287,7 @@ def scoreUnread(G, globMu, globStd, errorFac=0.6): for n in list(G.nodes): feedbacks = [] deepFeedbacks = [] + deepLen = 0 tagFeedbacks = [] node = G.nodes[n] if node['t'] == 'book': @@ -295,20 +296,27 @@ def scoreUnread(G, globMu, globStd, errorFac=0.6): for adj in adjacens: adjNode = G.nodes[adj] if 'score' in adjNode and adjNode['score'] != None: - if adjNode['t'] != 'tag': - feedbacks.append(adjNode['score']) - for fb in adjNode['feedbacks']: - deepFeedbacks.append(fb) + if adjNode['t'] == 'tag': + w = int(10/(len(G.adj[adj]))) + elif adjNode['t'] == 'topList': + w = int(G[n][adj]['wheight']*5) else: - tagFeedbacks.append(adjNode['score']) + w = 10 + feedbacks.append(adjNode['score']) + for fb in adjNode['feedbacks']: + for i in range(w): + deepFeedbacks.append(fb) + deepLen += w if len(feedbacks): node['mean'], node['std'] = norm.fit(deepFeedbacks) node['mean2'], node['std2'] = norm.fit(feedbacks) - f_mean, f_std = norm.fit(feedbacks) - node['se'] = globStd / math.sqrt(len(deepFeedbacks)) + if deepLen: + node['se'] = globStd / math.sqrt(deepLen) # - errorFac*node['se'] - node['score'] = ( - (node['mean'] - errorFac*node['se'])*4 + node['mean2']*2 + (f_mean)*1)/7 + node['std2'] * 0.25 + node['score'] = ( + (node['mean'] - errorFac*node['se'])*3 + node['mean2']*2)/5 + else: + node['score'] = globMu - errorFac*globStd if 'series' in node: if node['series_index'] == 1.0: node['score'] += 0.000000001