Allow keeping useless recommenders (args)
This commit is contained in:
parent
60067ed263
commit
c31a3d78e2
@ -508,7 +508,7 @@ def genScores(G, books):
|
|||||||
return globMu, globStd
|
return globMu, globStd
|
||||||
|
|
||||||
|
|
||||||
def recommendNBooks(G, mu, std, n, removeTopListsB=True):
|
def recommendNBooks(G, mu, std, n, removeTopListsB=True, removeUselessRecommenders=True):
|
||||||
removeRestOfSeries(G)
|
removeRestOfSeries(G)
|
||||||
removeBad(G, mu-std-1.5)
|
removeBad(G, mu-std-1.5)
|
||||||
removeKeepBest(G, int(n*2) + 5, maxDistForRead=1.5)
|
removeKeepBest(G, int(n*2) + 5, maxDistForRead=1.5)
|
||||||
@ -526,7 +526,8 @@ def recommendNBooks(G, mu, std, n, removeTopListsB=True):
|
|||||||
removeKeepBest(G, n, maxDistForRead=0.75)
|
removeKeepBest(G, n, maxDistForRead=0.75)
|
||||||
removeEdge(G)
|
removeEdge(G)
|
||||||
removeDangling(G, alsoBooks=True)
|
removeDangling(G, alsoBooks=True)
|
||||||
removeUnusedRecommenders(G)
|
if removeUselessRecommenders:
|
||||||
|
removeUnusedRecommenders(G)
|
||||||
|
|
||||||
scaleBooksByRating(G)
|
scaleBooksByRating(G)
|
||||||
scaleOpinionsByRating(G)
|
scaleOpinionsByRating(G)
|
||||||
@ -649,6 +650,7 @@ def cliInterface():
|
|||||||
parser.add_argument('--no-list', action="store_true")
|
parser.add_argument('--no-list', action="store_true")
|
||||||
parser.add_argument('--remove-edge', action="store_true")
|
parser.add_argument('--remove-edge', action="store_true")
|
||||||
parser.add_argument('--keep-top-lists', action="store_true")
|
parser.add_argument('--keep-top-lists', action="store_true")
|
||||||
|
parser.add_argument('--keep-useless-recommenders', action="store_true")
|
||||||
cmds = parser.add_subparsers(required=True, dest='cmd')
|
cmds = parser.add_subparsers(required=True, dest='cmd')
|
||||||
|
|
||||||
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
|
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
|
||||||
@ -678,7 +680,7 @@ def cliInterface():
|
|||||||
removeUnread(G)
|
removeUnread(G)
|
||||||
|
|
||||||
if args.cmd=="recommend":
|
if args.cmd=="recommend":
|
||||||
recommendNBooks(G, mu, std, args.n, not args.keep_top_lists)
|
recommendNBooks(G, mu, std, args.n, not args.keep_top_lists, not args.keep_useless_recommenders)
|
||||||
elif args.cmd=="read":
|
elif args.cmd=="read":
|
||||||
readBooksAnalysis(G, args.min_rating, args.all_tags, args.only_connected, not args.keep_top_lists)
|
readBooksAnalysis(G, args.min_rating, args.all_tags, args.only_connected, not args.keep_top_lists)
|
||||||
elif args.cmd=="analyze":
|
elif args.cmd=="analyze":
|
||||||
|
Loading…
Reference in New Issue
Block a user