/** * prints the specified message to stdout if debug is on and can also dump * the message to a log file * * @param message the message to print or store in a log file * @param onlyLog if true the message will only be put into the log file * but not to stdout */ protected void log(String message, boolean onlyLog) { // print to stdout? if (getDebug() && (!onlyLog)) System.out.println(Thread.currentThread().getStackTrace()[1].getClassName() +message); // log file? if (!getLogFile().isDirectory()) Debug.writeToFile(getLogFile().getAbsolutePath(), message, true); }
/** * prints the specified message to stdout if debug is on and can also dump * the message to a log file. * * @param message the message to print or store in a log file * @param onlyLog if true the message will only be put into the log file * but not to stdout */ public void log(String message, boolean onlyLog) { // print to stdout? if (getDebug() && (!onlyLog)) System.out.println(message); // log file? if (!getLogFile().isDirectory()) Debug.writeToFile(getLogFile().getAbsolutePath(), message, true); }
/** * Method that creates the classifier * @param isTrainingSet the Instances from which the classifier is created * @throws Exception */ public static void createClassifier(Instances isTrainingSet) throws Exception{ //create the classifier J48 j48 = new J48(); Classifier fc = (Classifier) j48 ; fc.buildClassifier(isTrainingSet); Debug.saveToFile(Vars.MODEL_PATH_ITEM_sample, fc); System.out.println("Model file saved to "+Vars.MODEL_PATH_ITEM_sample); }
/** * Method that creates the classifier * * @param isTrainingSet * the Instances from which the classifier is created * @throws Exception */ public static void createClassifier(Instances isTrainingSet) throws Exception { // create the classifier J48 j48 = new J48(); Classifier fc = (Classifier) j48; fc.buildClassifier(isTrainingSet); Debug.saveToFile(Vars.MODEL_PATH_USER_sample, fc); System.out .println("Model file saved to " + Vars.MODEL_PATH_USER_sample); }
/** * Method that creates the classifier given the training Instances * @param isTrainingSet the Instances * @throws Exception */ public static void createClassifier(Instances isTrainingSet) throws Exception{ //create the classifier J48 j48 = new J48(); Classifier fc = (Classifier) j48; fc.buildClassifier(isTrainingSet); Debug.saveToFile(Vars.MODEL_PATH_TOTAL_sample, fc); System.out.println("Model file saved to "+Vars.MODEL_PATH_TOTAL_sample); }
public void createClassifier(Classifier cls, Instances isTrainingSet, String model) throws Exception { // create the classifier Classifier fc = (Classifier) cls; fc.buildClassifier(isTrainingSet); Debug.saveToFile(model, fc); }