Skip to content

Commit

Permalink
Fixes reference stack recommendation to pick the best reference stack
Browse files Browse the repository at this point in the history
  • Loading branch information
miteshvp authored and miteshvp committed May 5, 2017
1 parent 9e901f8 commit e3a0289
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cucoslib/workers/recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def get_topmost_ref_stack(self, list_packages):
# Calculate similarity score of all reference stacks vs. input stack
for key, val in ref_stack_matching_components[0].items():
if key in ref_stack_full_components[0]:
ref_stk[key] = float(val) / float(ref_stack_full_components[0].get(key))

denominator = float(max(ref_stack_full_components[0].get(key), len(list_packages)))
ref_stk[key] = float(val) / denominator
# Get the name of reference stack with topmost similarity score
sname = max(ref_stk.keys(), key=(lambda key: ref_stk[key]))

Expand Down

0 comments on commit e3a0289

Please sign in to comment.