Here you can find the source of divData(int numTest, int numTrain)
public static int[] divData(int numTest, int numTrain)
//package com.java2s; //License from project: Apache License public class Main { public static int[] divData(int numTest, int numTrain) { int[] select = new int[numTest]; int tem1 = 0; for (int i = 0; i < numTest; i = i + 2) { select[tem1] = i;// w ww . j a v a 2 s .c o m if (tem1 < numTest - 1) { select[tem1 + 1] = numTrain + numTest - 1 - i; tem1 = tem1 + 2; } else { break; } } return select; } }