Allow keeping useless recommenders (args)

This commit is contained in:
Dominik Moritz Roth 2021-09-06 16:21:01 +02:00
parent 60067ed263
commit c31a3d78e2

View File

@ -508,7 +508,7 @@ def genScores(G, books):
return globMu, globStd
def recommendNBooks(G, mu, std, n, removeTopListsB=True):
def recommendNBooks(G, mu, std, n, removeTopListsB=True, removeUselessRecommenders=True):
removeRestOfSeries(G)
removeBad(G, mu-std-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)
removeEdge(G)
removeDangling(G, alsoBooks=True)
removeUnusedRecommenders(G)
if removeUselessRecommenders:
removeUnusedRecommenders(G)
scaleBooksByRating(G)
scaleOpinionsByRating(G)
@ -649,6 +650,7 @@ def cliInterface():
parser.add_argument('--no-list', action="store_true")
parser.add_argument('--remove-edge', 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')
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
@ -678,7 +680,7 @@ def cliInterface():
removeUnread(G)
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":
readBooksAnalysis(G, args.min_rating, args.all_tags, args.only_connected, not args.keep_top_lists)
elif args.cmd=="analyze":