Skip to content

Commit

Permalink
Training
Browse files Browse the repository at this point in the history
  • Loading branch information
Mengting Gu committed Sep 19, 2018
1 parent bae33e9 commit 16f4406
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions training.py
Expand Up @@ -76,8 +76,11 @@ def calculateZscores(positiveScores, negativeScores, trainingNegatives):

median = np.median(subset) #Slightly right-skewed. So median might be better starting point for fit
sigma = np.std(subset)
nopt,ncov = curve_fit(gauss_function, x, y, p0=[max(y), median, sigma])

try:
nopt,ncov = curve_fit(gauss_function, x, y, p0=[max(y), median, sigma])
except:
nopt = [1,median,sigma]

idx2 = 0
for currScore in positiveScores:
Zpos[idx2].append((currScore[idx] - nopt[1])/nopt[2])
Expand Down

0 comments on commit 16f4406

Please sign in to comment.