fixing predict for non-binary output, add testcase