public static void main( String[] args ) {

		Parser parser = new ARFFParser( "./banks/irisx.arff" );
		DataSet dataSet = parser.parse();

		/*int REPRESENTANTES = 4;

		List<Pattern> list = new LinkedList<Pattern>(dataSet);
		Collections.shuffle(list);
		Set<Pattern> randomSet = new HashSet<Pattern>(list);

		int index;
		Double d[][];

		d = new Double[REPRESENTANTES][];
		index = 0;
		for( Pattern p : randomSet ){
			if( p.getClassIndex() == 0 && index < REPRESENTANTES ){
				d[index++] = p.toDoubleVector();
			}
		}
		Double A[][] = Matrix.trans( d );

		d = new Double[REPRESENTANTES][];
		index = 0;
		for( Pattern p : randomSet ){
			if( p.getClassIndex() == 1 && index < REPRESENTANTES ){
				d[index++] = p.toDoubleVector();
			}
		}
		Double B[][] = Matrix.trans( d );

		d = new Double[REPRESENTANTES][];
		index = 0;
		for( Pattern p : randomSet ){
			if( p.getClassIndex() == 2 && index < REPRESENTANTES ){
				d[index++] = p.toDoubleVector();
			}
		}
		Double C[][] = Matrix.trans( d );*/

		Double[][] A = { { 5.10, 4.80, 5.20, 5.10 },
				{ 3.80, 3.40, 3.50, 3.70 },
				{ 1.60, 1.90, 1.50, 1.50 },
				{ 0.20, 0.20, 0.20, 0.40 }
		};
		Double[][] B = {
				{ 5.70, 6.60, 6.10, 5.20 },
				{ 3.00, 3.00, 2.90, 2.70 },
				{ 4.20, 4.40, 4.70, 3.90 },
				{ 1.20, 1.40, 1.40, 1.40 }
		};
		Double[][] C = {
				{ 6.50, 6.40, 7.30, 6.70 },
				{ 3.00, 2.80, 2.90, 3.30 },
				{ 5.20, 5.60, 6.30, 5.70 },
				{ 2.00, 2.10, 1.80, 2.10 }
		};

		imprime( A );
		imprime( B );
		imprime( C );

		int incorrectos = 0;
		for( Pattern p : dataSet ) {
			double s1 = test( A, p.toDoubleVector() );
			double s2 = test( B, p.toDoubleVector() );
			double s3 = test( C, p.toDoubleVector() );

			List<Double> values = new ArrayList<Double>();
			values.add( s1 );
			values.add( s2 );
			values.add( s3 );

			double min = Collections.min( values );

			if( min == s1 && p.getClassIndex() == 0 )
				System.out.println( "Correcto" );
			else if( min == s2 && p.getClassIndex() == 1 )
				System.out.println( "Correcto" );
			else if( min == s3 && p.getClassIndex() == 2 )
				System.out.println( "Correcto" );
			else {
				System.out.println( "Error // " + p.getClassIndex() );
				incorrectos++;
			}
			System.out.println( "====================================" );
		}

		System.out.println( ( 1 - incorrectos / (double) dataSet.size() ) * 100 );


	}