differntiated between numIterationsBCD and numIterations SGD, made calTestError more general funciton