public DataSet parse() {
		DataSet dataSet = new DataSet();
		int[] distribution = null;


		dataSet.setName( "Generic" );

		try {
			FileInputStream fis = new FileInputStream( file );
			DataInputStream din = new DataInputStream( fis );
			BufferedReader br = new BufferedReader( new InputStreamReader( din ) );


			Map<Integer, Integer> dist = new HashMap<Integer, Integer>();

			String line;
			int ix = 0;
			while( ( line = br.readLine() ) != null ) {

				if( ix == 0 ) {
					String commas[] = line.split( "," );
					for( int j = 0; j < commas.length - 1; j++ ) {
						dataSet.addAttribute( new Attribute( "a" + j, Attribute.Type.NUMERIC ) );
					}
					dataSet.setClasses( new Attribute( "clase" ) );
				}

				Pattern instance = new Pattern();
				instance.setDataSet( dataSet );

				String values[] = line.split( "," );
				for( int i = 0; i < values.length - 1; i++ ) {
					String rawValue = values[i].trim();
					instance.add( Double.valueOf( rawValue ) );
				}

				if( dataSet.getClasses().getValues().indexOf( values[values.length - 1] ) == -1 ) {
					dataSet.getClasses().getValues().add( values[values.length - 1] );
				}

				instance.setClassValue( values[values.length - 1] );

				dataSet.add( instance );

				if( dist.containsKey( instance.getClassIndex() ) ) {
					dist.put( instance.getClassIndex(), dist.get( instance.getClassIndex() ) + 1 );
				} else {
					dist.put( instance.getClassIndex(), 1 );
				}

				ix++;
			}

			distribution = new int[dist.size()];
			for( int i = 0; i < distribution.length; i++ ) {
				distribution[i] = dist.get( i );
			}

			dataSet.setDistribution( distribution );

			br.close();
			din.close();
			fis.close();
		} catch ( Exception e ) {
			e.printStackTrace();
			return null;
		}

		return dataSet;
	}