Fined tuned wheight of TopLists and Tags
This commit is contained in:
parent
486a8fb88f
commit
be0afb59c7
22
caliGraph.py
22
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':
|
||||
if adjNode['t'] == 'tag':
|
||||
w = int(10/(len(G.adj[adj])))
|
||||
elif adjNode['t'] == 'topList':
|
||||
w = int(G[n][adj]['wheight']*5)
|
||||
else:
|
||||
w = 10
|
||||
feedbacks.append(adjNode['score'])
|
||||
for fb in adjNode['feedbacks']:
|
||||
for i in range(w):
|
||||
deepFeedbacks.append(fb)
|
||||
else:
|
||||
tagFeedbacks.append(adjNode['score'])
|
||||
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['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
|
||||
|
Loading…
Reference in New Issue
Block a user