Skip to content

Commit

Permalink
fixed a bug with the word 'concept' as input, #7
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorf committed Apr 17, 2018
1 parent 6b91682 commit 1dcd161
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ def evaluate(annotations_hash, ont_acronym)
# removing hierarchySize from the calculation for now. There is a bug that returns hierarchySize as 0 for some annotations
# Ex: neocortex in MA ontology
anns.each { |ann| spec_score += get_annotation_score(ann) }

# Normalization by ontology size
spec_score = (spec_score / Math.log10(num_classes)).round(3)
divisor = Math.log10(num_classes)

if divisor > 0
spec_score = (spec_score / divisor).round(3)
else
spec_score = 0
end
end

if spec_score > top_spec_score
Expand Down

0 comments on commit 1dcd161

Please sign in to comment.