<commit_before>/**
 * File:        Launcher.java
 * Author:      <NAME> <<EMAIL>>, <<EMAIL>>
 * Target:      aludra.usc.edu running Java 1.6.0_23
 */
package com.weaverworx.usc.csci561.assignment3;

import com.weaverworx.usc.csci561.assignment3.knn.KNNRecord;
import com.weaverworx.usc.csci561.assignment3.util.ClassifierTypes;
import com.weaverworx.usc.csci561.assignment3.util.ClassifierInputReader;
import com.weaverworx.usc.csci561.assignment3.util.LearningUtil;

/**
 * Main class to launch the application.
 * 
 * @author jw
 * 
 * TODO: Reduce main() size, refactor out the logic necessary for the classifications.
 * Since there are two logical separations, this can abstracted somewhat simply.
 * TODO: Remove hard typed class index example, provide for this to be given to the
 * system in a different file as part of it's bootstrap.
 */
public class LaunchClassifier {
	private final static int EX_CLASS_INDEX = 784;

	/**
	 * Entry point.
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		ClassifierTypes classifier = LearningUtil.parseClassifierSystem(args);

		if (classifier.name().compareTo(ClassifierTypes.K_NEAREST_NEIGHBOR.name()) == 0) {
			int k = LearningUtil.parseKArgument(args); // Read k from user input
			// Get the training data and test data
			int[][] trainData = ClassifierInputReader.getTrainingData(LearningUtil.NUMBER_OF_FEATURES,
					LearningUtil.NUMBER_OF_CLASSES);
			int[][] testData = ClassifierInputReader.getTestData(LearningUtil.NUMBER_OF_FEATURES,
					LearningUtil.NUMBER_OF_CLASSES);

			// Set up the K-Nearest Neighbor Records
			KNNRecord[] knnRecords = new KNNRecord[trainData.length];
			for (int i = 0; i < trainData.length; i++) {<commit_msg>Small change, made final args[]<commit_after>/**
 * File:        Launcher.java
 * Author:      <NAME> <<EMAIL>>, <<EMAIL>>
 * Target:      aludra.usc.edu running Java 1.6.0_23
 */
package com.weaverworx.usc.csci561.assignment3;

import com.weaverworx.usc.csci561.assignment3.knn.KNNRecord;
import com.weaverworx.usc.csci561.assignment3.util.ClassifierTypes;
import com.weaverworx.usc.csci561.assignment3.util.ClassifierInputReader;
import com.weaverworx.usc.csci561.assignment3.util.LearningUtil;

/**
 * Main class to launch the application.
 * 
 * @author jw
 * 
 * TODO: Reduce main() size, refactor out the logic necessary for the classifications.
 * Since there are two logical separations, this can abstracted somewhat simply.
 * TODO: Remove hard typed class index example, provide for this to be given to the
 * system in a different file as part of it's bootstrap.
 */
public class LaunchClassifier {
	private final static int EX_CLASS_INDEX = 784;

	/**
	 * Entry point.
	 *
	 * @param args
	 */
	public static void main(final String[] args) {
		ClassifierTypes classifier = LearningUtil.parseClassifierSystem(args);

		if (classifier.name().compareTo(ClassifierTypes.K_NEAREST_NEIGHBOR.name()) == 0) {
			int k = LearningUtil.parseKArgument(args); // Read k from user input
			// Get the training data and test data
			int[][] trainData = ClassifierInputReader.getTrainingData(LearningUtil.NUMBER_OF_FEATURES,
					LearningUtil.NUMBER_OF_CLASSES);
			int[][] testData = ClassifierInputReader.getTestData(LearningUtil.NUMBER_OF_FEATURES,
					LearningUtil.NUMBER_OF_CLASSES);

			// Set up the K-Nearest Neighbor Records
			KNNRecord[] knnRecords = new KNNRecord[trainData.length];
			for (int i = 0; i < trainData.length; i++) {
{'fraction_non_alphanumeric': 0.10506512301013024, 'fraction_numerical': 0.017366136034732273, 'mean_word_length': 4.2763358778625955, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3019536', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1079, 'n_words': 289}