private static Predictor train(List<Instance> instances, String algorithm) {
		// TODO Train the model using "algorithm" on "data"
		// TODO Evaluate the model
		
		// generate initial values
		int sgd_iterations = 20;
		if (CommandLineUtilities.hasArg("sgd_iterations"))
			sgd_iterations = CommandLineUtilities.getOptionValueAsInt("sgd_iterations");
		
		double sgd_eta0 = 1.0;
		if (CommandLineUtilities.hasArg("sgd_eta0"))
			sgd_eta0 = CommandLineUtilities.getOptionValueAsFloat("sgd_eta0");
		
		double pegasos_lambda = 1e-4;
		if (CommandLineUtilities.hasArg("pegasos_lambda"))
			pegasos_lambda = CommandLineUtilities.getOptionValueAsFloat("pegasos_lambda");
		
		switch(algorithm.toLowerCase()){
		case "majority":
			MajorityPredictor pred = new MajorityPredictor();
			pred.train(instances);
			return pred;
		case "even_odd":
			EvenOddPredictor evenOddPred = new EvenOddPredictor();
			evenOddPred.train(instances);
			return evenOddPred;
		case "logistic_regression":
			LogisticRegressionSGD lr = new LogisticRegressionSGD(sgd_iterations, sgd_eta0);
			lr.train(instances);
			return lr;
		case "pegasos":
			Pegasos pegasos = new Pegasos(sgd_iterations, pegasos_lambda);
			pegasos.train(instances);
			return pegasos;
		default:
			throw new IllegalArgumentException("No implementation for '" + algorithm + "' algorithm. Please check the algorithm argument.");
		}
		
	}