public static void EM(Instances data, Instances originalData) throws Exception {
		
		// Create EM Clusterer
		EM em = new EM();
		em.setNumClusters(3);
		em.buildClusterer(data);
		
		// evaluate the EM clusterer
		ClusterEvaluation emEvaluation = new ClusterEvaluation();
		emEvaluation.setClusterer(em);
		emEvaluation.evaluateClusterer(data);
		System.out.println(emEvaluation.clusterResultsToString());
		
		// get class data as an array of doubles
		double[] classes = originalData.attributeToDoubleArray(0);
		
		double[] clusters = emEvaluation.getClusterAssignments();
		// compare classes and clusters
		int a = 0;
		int b = 0;
		int c = 0;
		int d = 0;
		
		for(int i = 0; i < classes.length; i++) {
			for(int j = i + 1; j < classes.length; j++) {
				if(classes[i] == classes[j]) {
					if(clusters[i] == clusters[j])
						a++;
					else
						b++;
				} else {
					if(clusters[i] == clusters[j])
						c++;
					else
						d++;
				}
			}
		}
		
		System.out.println("a: " + a + " b: " + b + " c: " + c + " d: " + d);
		double rand = (double) (a + d) / (double) (a + b + c + d);
		System.out.println("Rand: " + rand);
	}