public static List <string> Classify(string arffFile, string modelPath, string classifier, int numFeatures) { int cls = GetClassifier(classifier); WekaWrap p = new WekaWrap(); return(p.test(arffFile, modelPath, cls, numFeatures)); }
/// <summary> /// /// </summary> /// <param name="arffFile">example: @"C:\Users\jhero\Desktop\gag.arff"</param> /// <param name="modelPath">example: @"C:\Users\jhero\Desktop\model"</param> /// <param name="classifier"></param> /// <param name="numFeatures">Number of features, INCLUDING the class</param> public static void Train(string arffFile, string modelPath, string classifier, int numFeatures) { int cls = GetClassifier(classifier); WekaWrap p = new WekaWrap(); p.train(arffFile, modelPath, cls, numFeatures); }
/// <summary> /// A static function to create the ARFF and model files for WEKA from all the xml files in a directory. /// </summary> /// <param name="myClassifier">The type of classifier to use.</param> /// <param name="directory">The directory from which you should train the classifiers and grouper. /// Should be full path, ignores any files that don't end with ".xml"</param> public static void wekaSetUp(Classifier myClassifier, string directory) { createARFFs(directory); WekaWrap strokeClassif = new WekaWrap("strokeClassifier", myClassifier); WekaWrap textGrouper = new WekaWrap("textGrouper", myClassifier); //WekaWrap wireGrouper = new WekaWrap("wireGrouper", myClassifier); WekaWrap gateGrouper = new WekaWrap("gateGrouper", myClassifier); }
/// <summary> /// A static function to create the ARFF and model files for WEKA. /// </summary> /// <param name="myClassifier">The type of classifier to use.</param> /// <param name="fromDirectory">The list of full path filenames to use. Will only consider files ending in .xml </param> public static void wekaSetUp(Classifier myClassifier, List <string> filenames) { createARFFs(filenames); WekaWrap strokeClassif = new WekaWrap("strokeClassifier", myClassifier); WekaWrap textGrouper = new WekaWrap("textGrouper", myClassifier); //WekaWrap wireGrouper = new WekaWrap("wireGrouper", myClassifier); WekaWrap gateGrouper = new WekaWrap("gateGrouper", myClassifier); }