Skip to content

Commit

Permalink
Fixed an error in p-value computation for TcpClassifier.
Browse files Browse the repository at this point in the history
  • Loading branch information
donlnz committed Jan 29, 2018
1 parent 2e26f4c commit cdef0d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nonconformist/cp.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ def predict(self, x, significance=None):
train_y = np.hstack([self.train_y, y])
self.base_icp.fit(train_x, train_y)
scores = self.base_icp.nc_function.score(train_x, train_y)
n_gt = (scores[:-1] > scores[-1]).sum()
n_eq = (scores[:-1] == scores[-1]).sum()
ngt = (scores[:-1] > scores[-1]).sum()
neq = (scores[:-1] == scores[-1]).sum()

p[i, j] = calc_p(n_train, n_eq, n_gt, self.smoothing)
p[i, j] = calc_p(n_train, ngt, neq, self.smoothing)

if significance is not None:
return p > significance
Expand Down

0 comments on commit cdef0d1

Please sign in to comment.