private static void run(String[] args) throws IOException{
        // Parse the command line.
        String[] manditory_args = { "mode"};
        createCommandLineOptions();
        CommandLineUtilities.initCommandLineParameters(args, Classify.options, manditory_args);

        String mode = CommandLineUtilities.getOptionValue("mode");
        String data = CommandLineUtilities.getOptionValue("data");
        String predictions_file = CommandLineUtilities.getOptionValue("predictions_file");
        String algorithm = CommandLineUtilities.getOptionValue("algorithm");
        String model_file = CommandLineUtilities.getOptionValue("model_file");

        System.out.println(data+":");

        if (mode.equalsIgnoreCase("train")) {
            if (data == null || algorithm == null || model_file == null) {
                System.out.println("Train requires the following arguments: data, algorithm, model_file");
                System.exit(0);
            }
            // Load the training data.
            DataReader data_reader = new DataReader(data, true);
            List<Instance> instances = data_reader.readData();
            data_reader.close();

            // Train the models.
            Predictor predictor = train(instances, algorithm);
            saveObject(predictor, model_file);

        } else if (mode.equalsIgnoreCase("test")) {
            if (data == null || predictions_file == null || model_file == null) {
                System.out.println("Train requires the following arguments: data, predictions_file, model_file");
                System.exit(0);
            }

            // Load the test data.
            DataReader data_reader = new DataReader(data, true);
            List<Instance> instances = data_reader.readData();
            data_reader.close();

            // Load the models.
            Predictor predictor = (Predictor)loadObject(model_file);
            evaluateAndSavePredictions(predictor, instances, predictions_file);
        } else {
            System.out.println("Requires mode argument.");
        }


    }