Skip to content

Commit

Permalink
Votes normalized.
Browse files Browse the repository at this point in the history
  • Loading branch information
scastlara committed Oct 15, 2018
1 parent 17f9f9e commit 943d543
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ppaxe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,9 +979,21 @@ def predict(self):
self.votes = round(pred[0], 3)
if pred >= 0.55:
self.label = True
self._normalize_pred()
else:
self.label = False


def _normalize_pred(self):
'''
Changes scale of votes in self.votes from 0.55-1 to 0-1.
'''
before = self.votes
self.votes = (self.votes-0.55)/(1-0.55)
self.votes = round(self.votes, 3)
print("B: %s A: %s\n" % (before, self.votes))


def to_html(self):
'''
Transforms candidate to html with only involved proteins tagged and only
Expand Down

0 comments on commit 943d543

Please sign in to comment.