oeyh / NN

MIT License
1 stars 0 forks source link

Assignment8 invalid value encountered in long_scalars #5

Closed oeyh closed 5 years ago

oeyh commented 5 years ago

Warnings running codes in assignment 8:

/lib/python3.6/site-packages/ipykernel_launcher.py:26: RuntimeWarning: invalid value encountered in long_scalars

oeyh commented 5 years ago

Root cause: In selectThreshold(yval, pval) function, tp+fp equals to 0 when epsilon equals to min(pval), which causes a "division by zero" case when computing prec. Fix: added a check to avoid "division by zero" when calculating prec and rec.