Ejemplo n.º 1
0
 private void SaveExcludedTrainingIDInfo() throws Exception {
   ArrayList<String> excludedTrainingIDs =
       Singletons.InstanceVault.GetCrossValidationAssignments().GetAllExcludedTrainIDs();
   if (excludedTrainingIDs.size() > 0) {
     String filePath = Settings.GetOutputSettingsDir(true) + "Excluded_Training_IDs.txt";
     String output = ListUtilities.Join(excludedTrainingIDs, "\n");
     FileUtilities.WriteLineToFile(
         filePath,
         "# IDs of data instances that were excluded randomly from training sets, according to the specified experiment settings. If this is a cross-validation experiment, the instances were removed from different folds.");
     FileUtilities.AppendLineToFile(filePath, output);
   }
 }
Ejemplo n.º 2
0
  /**
   * This method saves various description files to the output. These tasks are quick to execute, so
   * they are grouped together rather than parallelized.
   *
   * @throws Exception
   */
  public void SaveExperimentDescriptionFiles() throws Exception {
    // Save the version file in output so people know which version was used
    FileUtilities.CopyFile(
        Settings.VERSION_FILE, Settings.GetOutputSettingsDir(false) + Settings.VERSION_FILE);

    // Copy the experiment file
    FileUtilities.WriteLineToFile(
        Settings.GetOutputSettingsDir(false) + "Experiment_Settings.txt",
        "# All settings used in this experiment, whether explicitly set or used by default in the absence of an explicit setting");
    FileUtilities.AppendTextToFile(
        Settings.GetOutputSettingsDir(false) + "Experiment_Settings.txt",
        Singletons.Config.toString());

    if (Settings.NeedToClassify()) {
      // Copy the algorithm configuration files
      FileUtilities.CopyFile(
          Settings.LEARNER_TEMPLATES_FILE,
          Settings.GetOutputSettingsDir(false)
              + new File(Settings.LEARNER_TEMPLATES_FILE).getName());

      // Copy the algorithm configuration files
      FileUtilities.CopyFile(
          Settings.CLASSIFICATION_ALGORITHMS_FILE,
          Settings.GetOutputSettingsDir(false)
              + new File(Settings.CLASSIFICATION_ALGORITHMS_FILE).getName());

      if (Settings.NeedToSelectFeatures())
        FileUtilities.CopyFile(
            Settings.FEATURE_SELECTION_ALGORITHMS_FILE,
            Settings.GetOutputSettingsDir(false)
                + new File(Settings.FEATURE_SELECTION_ALGORITHMS_FILE).getName());

      SaveExcludedTrainingIDInfo();
      SaveCrossValidationAssignments();
    }
  }