private static void createFoldSVM(String[] args) throws FileNotFoundException, IOException {
        String orgDataFile = args[1];
        int noFolds = Integer.parseInt(args[2]);
        BufferedReader br1 = new BufferedReader(new FileReader(orgDataFile));
        ArrayList<String> posData = new ArrayList<String>();
        ArrayList<String> negData = new ArrayList<String>();
        while (br1.ready()) {
            String Y = br1.readLine().trim();
            String[] X = Y.split(" ");
            if (X[0].contains("+1")) {
                posData.add(Y);
            } else {
                negData.add(Y);
            }
        }
        int testposSize = posData.size() / noFolds;
        int testnegSize = negData.size() / noFolds;

        Random generator = new Random();

        ArrayList<String> posTrainData = new ArrayList<String>();
        ArrayList<String> negTrainData = new ArrayList<String>();
        ArrayList<String> posTestData = new ArrayList<String>();
        ArrayList<String> negTestData = new ArrayList<String>();
        for (int fold = 0; fold < noFolds; fold++) {
            posTrainData.clear();
            posTrainData.addAll(posData);
            posTestData.clear();
            negTrainData.clear();
            negTrainData.addAll(negData);
            negTestData.clear();
            while (posTestData.size() < testposSize) {
                posTestData.add(posTrainData.remove(generator.nextInt(posTrainData.size())));
            }
            while (negTestData.size() < testnegSize) {
                negTestData.add(negTrainData.remove(generator.nextInt(negTrainData.size())));
            }
            // open test file
            String fileName = orgDataFile + "test" + Integer.toString(fold);
            FileWriter fstream = new FileWriter(fileName);
            BufferedWriter out = new BufferedWriter(fstream);
            for (String pos : posTestData) {
                out.write(pos + "\n");
            }
            for (String neg : negTestData) {
                out.write(neg + "\n");
            }
            out.close();
            //opentrainfile
            fileName = orgDataFile + "train" + Integer.toString(fold);
            fstream = new FileWriter(fileName);
            out = new BufferedWriter(fstream);
            for (String pos : posTrainData) {
                out.write(pos + "\n");
            }
            for (String neg : negTrainData) {
                out.write(neg + "\n");
            }
            out.close();
        }
    }