JkernelMachines: limiting while loop to train