private static Predictor train(List<Instance> instances, String algorithm, int numIter,
			double gd_eta, int numFeaturesToSelect, double online_learning_rate, int online_training_iterations,
			double polynomial_kernel_exponent, double cluster_lambda, int num_clusters, int clustering_training_iterations) {
		// TODO Train the model using "algorithm" on "data"
		// TODO Evaluate the model
		
		Predictor returnPredictor;
		AccuracyEvaluator printEvaluator = new AccuracyEvaluator();
		double accuracy;
		
		if (algorithm.equals("majority")) {
			
			returnPredictor = new MajorityPredictor(instances);
		}
		else if (algorithm.equals("even_odd")){
			
			returnPredictor = new EvenOddPredictor();
		}
		else if (algorithm.equals("logistic_regression")){
			
			returnPredictor = new LogisticRegressionPredictor(instances, numIter, gd_eta, numFeaturesToSelect);
		}
		else if (algorithm.equals("margin_perceptron")) {
			
			returnPredictor = new MarginPerceptronPredictor(instances, online_learning_rate, online_training_iterations);
		}
		else if (algorithm.equals("perceptron_linear_kernel")) {
			
			returnPredictor = new MarginDualPerceptronPredictor(instances, online_learning_rate, online_training_iterations, polynomial_kernel_exponent, algorithm);
		}
		else if (algorithm.equals("perceptron_polynomial_kernel")) {
			
			returnPredictor = new MarginDualPerceptronPredictor(instances, online_learning_rate, online_training_iterations, polynomial_kernel_exponent, algorithm);
		}
		else if (algorithm.equals("mira")) {
			
			returnPredictor = new MiraPredictor(instances, online_training_iterations);
		}
		else if (algorithm.equals("lambda_means")) {
			
			returnPredictor = new LambdaMeansPredictor(instances, clustering_training_iterations, cluster_lambda);
		}
		else if (algorithm.equals("ska")) {
			
			returnPredictor = new StochasticKMeansPredictor(instances, clustering_training_iterations, num_clusters);
		}
		else {
			
			returnPredictor = null;
		}
		
		accuracy = printEvaluator.evaluate(instances, returnPredictor);
		System.out.println("Accuracy: " + accuracy);
		
		return returnPredictor;
	}