@Test
	public void testMacroGetPrecisionRecallCurveLAST() {
		
		Map<Integer, String> indexToState = new TreeMap<Integer,String>(); indexToState.put(0, "s1"); indexToState.put(1, "s2");  indexToState.put(2, "s3");
		Map<Integer, String> indexToStateAgg = new TreeMap<Integer,String>(); indexToStateAgg.put(2, "s1"); indexToStateAgg.put(0, "s2");  indexToStateAgg.put(1, "s3");
		
		ClassificationStandardPerformances<Double> performances1 = new ClassificationStandardPerformances<Double>(indexToState);
		performances1.addResults(generateDataset1());
		ClassificationStandardPerformances<Double> performances2 = new ClassificationStandardPerformances<Double>(indexToState);
		performances2.addResults(generateDataset2());
		
		MicroMacroClassificationPerformances<Double,ClassificationStandardPerformances<Double>> aggPerformances = new MicroMacroClassificationPerformances<Double,ClassificationStandardPerformances<Double>>(indexToStateAgg);
		aggPerformances.setMicroFlag(false);
		aggPerformances.addPerformances(performances1);
		aggPerformances.addPerformances(performances2);
		aggPerformances.setMacroPrecisionRecallSamplesNumber(10);
		aggPerformances.setMacroPrecisionRecallConfidenceInterval("95%");
		
		double[] point;
		List<double[]> trueCurve;
		List<double[]> resultcurve;
		// s1
		trueCurve = new Vector<double[]>();
		point = new double[4]; point[0] = 0.0; point[1] = (1.0 + 1.0) / 2.0; point[2] = 0.832; point[3] = 1.0;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.1; point[1] = (1.0 + 1.0) / 2.0; point[2] = 0.832; point[3] = 1.0;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.2; point[1] = (1.0 + 1.0) / 2.0; point[2] = 0.832; point[3] = 1.0;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.3; point[1] = (1.0 + 0.9) / 2.0; point[2] = 0.757; point[3] = 0.991;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.4; point[1] = (1.0 + 0.7) / 2.0; point[2] = 0.633; point[3] = 0.949;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.5; point[1] = (1.0 + 0.5) / 2.0; point[2] = 0.525; point[3] = 0.890;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.6; point[1] = (0.9 + 0.4888888889) / 2.0; point[2] = 0.470; point[3] = 0.853;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.7; point[1] = (0.8 + 0.4777777778) / 2.0; point[2] = 0.417; point[3] = 0.814;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.8; point[1] = (0.68 + 0.4666666667) / 2.0; point[2] = 0.358; point[3] = 0.764;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.9; point[1] = (0.54 + 0.4555555556) / 2.0; point[2] = 0.293; point[3] = 0.703;
		trueCurve.add(point);
		point = new double[4]; point[0] = 1.0; point[1] = (0.4 + 0.4444444444) / 2.0; point[2] = 0.232; point[3] = 0.638;
		trueCurve.add(point);
		resultcurve = aggPerformances.getPrecisionRecallCurve("s1");
		assertTrue(trueCurve.size() == resultcurve.size());
		for(int i = 0; i < trueCurve.size(); ++i) {
			assertTrue(resultcurve.get(i).length == trueCurve.get(i).length);
			assertTrue(doublesEqual( trueCurve.get(i)[0], resultcurve.get(i)[0]));
			assertTrue(doublesEqual( trueCurve.get(i)[1], resultcurve.get(i)[1]));
			assertTrue(doublesEqual( trueCurve.get(i)[2], (Math.round(resultcurve.get(i)[2]*1000))/1000.0));
			assertTrue(doublesEqual( trueCurve.get(i)[3], (Math.round(resultcurve.get(i)[3]*1000))/1000.0));
		}
		// s2
		trueCurve = new Vector<double[]>();
		point = new double[4]; point[0] = 0.0; point[1] = (1.0 + 1.0) / 2.0; point[2] = 0.832; point[3] = 1.0;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.1; point[1] = (1.0 + 0.8666666667) / 2.0; point[2] = 0.735; point[3] = 0.986;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.2; point[1] = (1.0 + 0.7333333333) / 2.0; point[2] = 0.653; point[3] = 0.957;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.3; point[1] = (1.0 + 0.6) / 2.0; point[2] = 0.578; point[3] = 0.921;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.4; point[1] = (0.9 + 0.4666666667) / 2.0; point[2] = 0.459; point[3] = 0.846;
		trueCurve.add(point);		
		point = new double[4]; point[0] = 0.5; point[1] = (0.75 + 0.3333333333) / 2.0; point[2] = 0.330; point[3] = 0.739;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.6; point[1] = (0.6 + 0.3111111111) / 2.0; point[2] = 0.259; point[3] = 0.667;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.7; point[1] = (0.48 + 0.2888888889) / 2.0; point[2] = 0.203; point[3] = 0.604;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.8; point[1] = (0.42 + 0.2666666667) / 2.0; point[2] = 0.173; point[3] = 0.566;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.9; point[1] = (0.36 + 0.2444444444) / 2.0; point[2] = 0.144; point[3] = 0.527;
		trueCurve.add(point);
		point = new double[4]; point[0] = 1.0; point[1] = (0.3 + 0.2222222222) / 2.0; point[2] = 0.117; point[3] = 0.486;
		trueCurve.add(point);
		resultcurve = aggPerformances.getPrecisionRecallCurve("s2");
		assertTrue(trueCurve.size() == resultcurve.size());
		for(int i = 0; i < trueCurve.size(); ++i) {
			assertTrue(trueCurve.get(i).length == resultcurve.get(i).length);
			assertTrue(doublesEqual( trueCurve.get(i)[0], resultcurve.get(i)[0]));
			assertTrue(doublesEqual( trueCurve.get(i)[1], resultcurve.get(i)[1]));
			assertTrue(doublesEqual( trueCurve.get(i)[2], (Math.round(resultcurve.get(i)[2]*1000))/1000.0));
			assertTrue(doublesEqual( trueCurve.get(i)[3], (Math.round(resultcurve.get(i)[3]*1000))/1000.0));
		}
		// s3
		trueCurve = new Vector<double[]>();
		point = new double[4]; point[0] = 0.0; point[1] = (1.0 + 1.0) / 2.0; point[2] = 0.832; point[3] = 1.0;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.1; point[1] = (1.0 + 0.85) / 2.0; point[2] = 0.724; point[3] = 0.983;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.2; point[1] = (1.0 + 0.7) / 2.0; point[2] = 0.633; point[3] = 0.949;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.3; point[1] = (1.0 + 0.55) / 2.0; point[2] = 0.551; point[3] = 0.906;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.4; point[1] = (1.0 + 0.48) / 2.0; point[2] = 0.515; point[3] = 0.884;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.5; point[1] = (1.0 + 0.45) / 2.0; point[2] = 0.500; point[3] = 0.874;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.6; point[1] = (1.0 + 0.42) / 2.0; point[2] = 0.485; point[3] = 0.864;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.7; point[1] = (0.93 + 0.3933333333) / 2.0; point[2] = 0.439; point[3] = 0.830;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.8; point[1] = (0.72 + 0.3733333333) / 2.0; point[2] = 0.335; point[3] = 0.743;
		trueCurve.add(point);
		point = new double[4]; point[0] = 0.9; point[1] = (0.51 + 0.3533333333) / 2.0; point[2] = 0.240; point[3] = 0.647;
		trueCurve.add(point);
		point = new double[4]; point[0] = 1.0; point[1] = (0.3 + 0.3333333333) / 2.0; point[2] = 0.154; point[3] = 0.541;
		trueCurve.add(point);
		resultcurve = aggPerformances.getPrecisionRecallCurve("s3");
		assertTrue(trueCurve.size() == resultcurve.size());
		for(int i = 0; i < trueCurve.size(); ++i) {
			assertTrue(trueCurve.get(i).length == resultcurve.get(i).length);
			assertTrue(doublesEqual( trueCurve.get(i)[0], resultcurve.get(i)[0]));
			assertTrue(doublesEqual( trueCurve.get(i)[1], resultcurve.get(i)[1]));
			assertTrue(doublesEqual( trueCurve.get(i)[2], (Math.round(resultcurve.get(i)[2]*1000))/1000.0));
			assertTrue(doublesEqual( trueCurve.get(i)[3], (Math.round(resultcurve.get(i)[3]*1000))/1000.0));
		}
	}