Class ArffSaver

    • Constructor Detail

      • ArffSaver

        public ArffSaver()
        Constructor
    • Method Detail

      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Parses the options for this object.

        Valid options are:

         -i <the input file>
          The input file
         
         -o <the output file>
          The output file
         
         -compress
          Compresses the data (uses '.arff.gz' as extension instead of '.arff')
          (default: off)
         
         -decimal <num>
          The maximum number of digits to print after the decimal
          place for numeric values (default: 6)
         
        Specified by:
        setOptions in interface OptionHandler
        Overrides:
        setOptions in class AbstractFileSaver
        Parameters:
        options - the options to use
        Throws:
        Exception - if setting of options fails
      • setMaxDecimalPlaces

        public void setMaxDecimalPlaces​(int maxDecimal)
        Set the maximum number of decimal places to print
        Parameters:
        maxDecimal - the maximum number of decimal places to print
      • getMaxDecimalPlaces

        public int getMaxDecimalPlaces()
        Get the maximum number of decimal places to print
        Returns:
        the maximum number of decimal places to print
      • maxDecimalPlacesTipText

        public String maxDecimalPlacesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • compressOutputTipText

        public String compressOutputTipText()
        Returns the tip text for this property
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • getCompressOutput

        public boolean getCompressOutput()
        Gets whether the output data is compressed.
        Returns:
        true if the output data is compressed
      • setCompressOutput

        public void setCompressOutput​(boolean value)
        Sets whether to compress the output.
        Parameters:
        value - if truee the output will be compressed
      • globalInfo

        public String globalInfo()
        Returns a string describing this Saver
        Returns:
        a description of the Saver suitable for displaying in the explorer/experimenter gui
      • writeIncremental

        public void writeIncremental​(Instance inst)
                              throws IOException
        Saves an instances incrementally. Structure has to be set by using the setStructure() method or setInstances() method.
        Specified by:
        writeIncremental in interface Saver
        Overrides:
        writeIncremental in class AbstractSaver
        Parameters:
        inst - the instance to save
        Throws:
        IOException - throws IOEXception if an instance cannot be saved incrementally.
      • main

        public static void main​(String[] args)
        Main method.
        Parameters:
        args - should contain the options of a Saver.