public Dataset(String path) {
		List<String> lines = new ArrayList<>();
		
		try(BufferedReader br = new BufferedReader(new InputStreamReader(
				new BufferedInputStream(new FileInputStream(new File(path)))))) {			
			while(true) {
				String line = br.readLine();
				
				if(line == null) {
					break;
				}
				
				line = line.trim();
				
				if(!line.isEmpty()) {
					lines.add(line);
				}
			}
		} catch(IOException e) {
			e.printStackTrace();
		}
		
		this.m = lines.size();
		this.samples = new DataSample[this.m];
		
		for(int i = 0; i < lines.size(); i++) {
			String[] parts = lines.get(i).split("\\s+");
			double[] data = new double[parts.length - 1];
			
			for(int j = 0; j < data.length; j++) {
				data[j] = Double.parseDouble(parts[j]);
			}
			
			this.samples[i] = new DataSample(new Vector(data), parts[parts.length - 1]);
		}
		
		this.n = this.samples[0].data.size();
	}