Modified Wanli's code to calculate APER and FNER multiple Threshold values.