public static void main(String [] args) {
		
		File classification = null;
		File clicks = null;
		
		//createArff(".//data//183102000_Ref_Class.csv",".//data//justinsbrain.arff",60,1660);
		JFrame parent = new JFrame();
		JFileChooser selectFile = new JFileChooser();
		selectFile.setCurrentDirectory(new File("C:\\Users\\shammond\\Desktop\\Classification_Files"));
		int fcval = selectFile.showDialog(parent, "Select a classification file.");
		if (fcval==JFileChooser.APPROVE_OPTION)
			classification = selectFile.getSelectedFile();
		else
			System.exit(0);
		selectFile.setCurrentDirectory(new File("logs"));
		fcval = selectFile.showDialog(parent, "Select a clicks file.");
		if (fcval==JFileChooser.APPROVE_OPTION)
			clicks = selectFile.getSelectedFile();
		else
			System.exit(0);
		
		String subjectName = (String)JOptionPane.showInputDialog(parent,"Enter Subject Name:", "File Name",JOptionPane.PLAIN_MESSAGE);
		if (subjectName==null)
			System.exit(0);
		int start = 0;
		try {
			start = Integer.parseInt(JOptionPane.showInputDialog(parent,"Enter start index:", "Start Index",JOptionPane.PLAIN_MESSAGE));
		}
		catch (NumberFormatException e) {
			e.printStackTrace();
			System.exit(0);
		}
		
		//createArff(".//src//thesis//184103000_Classification.csv",".//logs//3-8-2014-adamd-clicks","adamd-test.arff",57,1657);
		
		createArff(classification,clicks,subjectName,start);
		
		//if (true)
			//return;
		
		try {
			breader = new BufferedReader(new FileReader(".//arffFiles//" + subjectName +".arff"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			System.exit(0);
		}
		
		/*try {
			arffLoader = new ArffReader(breader);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			System.exit(0);
		}*/
		
		try {
			data = new Instances(breader);
			breader.close();
		} catch (IOException e1) {
			e1.printStackTrace();
			System.exit(0);
		}
		data.setClassIndex(data.numAttributes()-1);
		
		J48 dtree = new J48();
		dtree.setConfidenceFactor((float).1);
		dtree.setMinNumObj(20);
		try {
			dtree.buildClassifier(data);
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		}
		
		BufferedWriter bsc = null;
		try {
			bsc = new BufferedWriter(new FileWriter(".//src//thesis//" + subjectName + "Classifier.java"));
			bsc.write("package thesis;");
			bsc.newLine();
			bsc.newLine();
		} catch (IOException e1) {
			e1.printStackTrace();
			System.exit(0);
		}
		
		try {
			//System.out.println(dtree.toSource("BrainStateClassifier"));
			bsc.write(dtree.toSource(subjectName + "Classifier"));
			bsc.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		}
		
		/*try {
			System.out.println(dtree.graph());
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		}
		*/
		return;
	}