Java 类weka.core.Debug 实例源码

项目:jbossBA    文件:GridSearch.java   
/**
 * 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);
}
项目:multisearch-weka-package    文件:MultiSearch.java   
/**
 * 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);
}
项目:computational-verification    文件:ItemClassifier.java   
/**
 * 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);
}
项目:computational-verification    文件:UserClassifier.java   
/**
 * 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);

}
项目:computational-verification    文件:TotalClassifier.java   
/**
 * 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);
}
项目:computational-verification    文件:VerifHandler.java   
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);

    }