ace
Class CommandLine

java.lang.Object
  extended by ace.CommandLine
All Implemented Interfaces:
java.io.Serializable

public class CommandLine
extends java.lang.Object
implements java.io.Serializable

Parses and processes the flags and options given at the command line. Upon instantiation, this class reads all commands from the command line and stores them as public fields. These fields are accessed by Main to determine whether ACE should be run from the GUI or the CLI. The method processRequests will direct the flow of execution if Main decides that ACE should be run from the command line.

NOTE: for training_classifier_type and cross_validation_classifier_type, the codes for the types of WEKA classifiers are as follows:

  • Unweighted k-nn (k = 1): IBk
  • Naive Bayesian (Gaussian): NaiveBayes
  • Support Vector Machine: SMO
  • C4.5 Decision Tree: J48
  • Backdrop Neural Network: MultilayerPerceptron
  • AdaBoost seeded with C4.5 Decision Trees: AdaBoostM1
  • Bagging seeded with C4.5 Decision Trees: Bagging

    See Also:
    Serialized Form

    Field Summary
     java.lang.String arff_file
              If Instances are being loaded from an ARFF file, this specifies the path to that file.
     java.lang.String classifications_file
              The path to the ACE XML classifications file for this project.
     java.lang.String classifier_type
              The type of Weka Classifier to be trained.
     java.lang.String cross_validation_string
              Specifies the number of folds to be used in cross validation.
     java.lang.String[] dozip
               
     java.lang.String experimentation_string
              Specifies the number of folds to be used for cross validation during experimentation.
     java.lang.String feature_key_file
              The path to the ACE XML feature definitions file for this project.
     java.lang.String feature_selector
              A code specifying what type of dimensionality reduction to be performed.
     java.lang.String[] feature_vector_files
              Array of paths to ACE XML feature vectors files for this project.
     java.lang.String file_type
               
     java.lang.String load_zip
              Specifies the path to the ACE zip file if loading data from an ACE zip file.
     double max_membership
              The maximum number of instances that may belong to any one class.
     double max_spread
              The maximum ratio of instances that are permitted belonging to different classes.
     boolean order_randomly
              If true, instances are ordered randomly before training, cross validation, or experimenting.
     java.lang.String project_path
              Specifies the path to the ACE XML project file if loading data from an ACE project file or an ACE zip file.
     java.lang.String save_file
              The file to which the results or the TrainedModel (depending on which processing is being performed) will be saved.
     boolean save_intermediate_arffs
              Whether or not to save training or testing data to an arff file after parsing, after thinning, and again after feature selection, if any.
     java.lang.String taxonomy_file
              The path to the ACE XML taxonomy file for this project.
     java.lang.String testing_to_load_classifiers_file
              The name of file from which the TrainModel object to be used for classification is to be read.
     boolean train
              Whether or not training is to be performed.
     boolean unzip
               
     boolean verbose
              Specifies whether or not to include detailed information in the results output.
     java.lang.String zip_add
               
     java.lang.String zip_directory
              The directory to which the zip file (if specified) will be unzipped.
     java.lang.String zip_extract
              The name of the single file that the user would like to exract from the specified zip file.
     java.lang.String zip_file
               
     
    Constructor Summary
    CommandLine(java.lang.String[] options)
              Reads options from the command line and sets fields accordinly.
     
    Method Summary
     void dumpContents()
              Prints all command line options to standard out.
    static void printHelpMessage()
              Prints a help message to standard out with brief instructions redarding the use of ACE from the command line.
     void processRequests()
              Performs actions based on the options specified at the command line.
     void processZip()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    classifier_type

    public java.lang.String classifier_type
    The type of Weka Classifier to be trained.


    save_file

    public java.lang.String save_file
    The file to which the results or the TrainedModel (depending on which processing is being performed) will be saved.


    feature_selector

    public java.lang.String feature_selector
    A code specifying what type of dimensionality reduction to be performed.


    order_randomly

    public boolean order_randomly
    If true, instances are ordered randomly before training, cross validation, or experimenting.


    max_spread

    public double max_spread
    The maximum ratio of instances that are permitted belonging to different classes.


    max_membership

    public double max_membership
    The maximum number of instances that may belong to any one class.


    save_intermediate_arffs

    public boolean save_intermediate_arffs
    Whether or not to save training or testing data to an arff file after parsing, after thinning, and again after feature selection, if any.


    project_path

    public java.lang.String project_path
    Specifies the path to the ACE XML project file if loading data from an ACE project file or an ACE zip file.


    load_zip

    public java.lang.String load_zip
    Specifies the path to the ACE zip file if loading data from an ACE zip file.


    taxonomy_file

    public java.lang.String taxonomy_file
    The path to the ACE XML taxonomy file for this project.


    feature_key_file

    public java.lang.String feature_key_file
    The path to the ACE XML feature definitions file for this project.


    classifications_file

    public java.lang.String classifications_file
    The path to the ACE XML classifications file for this project.


    feature_vector_files

    public java.lang.String[] feature_vector_files
    Array of paths to ACE XML feature vectors files for this project.


    arff_file

    public java.lang.String arff_file
    If Instances are being loaded from an ARFF file, this specifies the path to that file.


    train

    public boolean train
    Whether or not training is to be performed.


    testing_to_load_classifiers_file

    public java.lang.String testing_to_load_classifiers_file
    The name of file from which the TrainModel object to be used for classification is to be read.


    cross_validation_string

    public java.lang.String cross_validation_string
    Specifies the number of folds to be used in cross validation.


    experimentation_string

    public java.lang.String experimentation_string
    Specifies the number of folds to be used for cross validation during experimentation.


    verbose

    public boolean verbose
    Specifies whether or not to include detailed information in the results output.


    zip_file

    public java.lang.String zip_file

    file_type

    public java.lang.String file_type

    unzip

    public boolean unzip

    dozip

    public java.lang.String[] dozip

    zip_add

    public java.lang.String zip_add

    zip_extract

    public java.lang.String zip_extract
    The name of the single file that the user would like to exract from the specified zip file.


    zip_directory

    public java.lang.String zip_directory
    The directory to which the zip file (if specified) will be unzipped. If not specified at the command line, the default directory name is simply the name of the zip file with the extension removed.

    Constructor Detail

    CommandLine

    public CommandLine(java.lang.String[] options)
                throws java.lang.Exception
    Reads options from the command line and sets fields accordinly. Instantiates objects needed for training and testing operations. Variables are set to null if their value is not specified at the command line. This constructor only parses the command line arguments, no actual processing occurs other than the decompressing and parsing of ACE zip files and the parsing of ACE project files.

    Parameters:
    options - The command line arguments.
    Throws:
    java.lang.Exception - If invalid command line arguments are used.
    Method Detail

    processRequests

    public void processRequests()
                         throws java.lang.Exception
    Performs actions based on the options specified at the command line. Uses the fields that were set in the constructor of this class to direct the flow of execution. This method is called by Main if it decidedes (based on the fields of this class) that ACE should be run from the command line (as opposed to the GUI). This method is never called by the GUI.

    Throws:
    java.lang.Exception - If invalid input files were specified.

    processZip

    public void processZip()
                    throws java.lang.Exception
    Throws:
    java.lang.Exception

    printHelpMessage

    public static void printHelpMessage()
    Prints a help message to standard out with brief instructions redarding the use of ACE from the command line. All possible command line flags are listed and described.


    dumpContents

    public void dumpContents()
    Prints all command line options to standard out. Useful for testing.