Skip to content

Commit

Permalink
fix docstring of auc, change test statement of None
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatYYX committed Jul 23, 2018
1 parent ca4ea85 commit e8552d2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions rltk/evaluation/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ def __init__(self, trial_list: list = None):
def add_trial(self, trial: Trial):
self.trial_list.append(trial)

"""
Args:
x (list): list of x coordinates
y (list): list of y coordinates
"""

def auc(self, x, y):
"""
Args:
x (list): list of x coordinates
y (list): list of y coordinates
"""
coords = sorted([(x[i], y[i]) for i in range(len(x))])
coords_reduced = dict()
prev = coords[0][0]
Expand Down Expand Up @@ -106,7 +105,7 @@ def plot(self, parameter_list, label_max=False, label_min=False, auc_params=None
plt.annotate("(" + ("%.3f" % global_min[0]) + ", " + ("%.3f" % global_min[1]) + ")",
xy=(global_min[0] - 0.1, global_min[1] - 0.05))

if auc_params != None:
if not auc_params:
vals = self.auc(x, y)
auc = vals[0]
area_label = 'AUC: ' + ('%.5f' % auc)
Expand All @@ -117,7 +116,7 @@ def plot(self, parameter_list, label_max=False, label_min=False, auc_params=None
y_vals = vals[2]
plt.fill_between(x, y)

if aoc_params != None:
if not aoc_params:
vals = self.auc(x, y)
aoc = 1 - vals[0]
area_label = 'AOC: ' + ('%.5f' % aoc)
Expand Down

0 comments on commit e8552d2

Please sign in to comment.