Documentation of 'smile.data.parser.ArffParser' Java class
ArffParser
smile.data.parser

Class ArffParser



  • public class ArffParser
    extends java.lang.Object
    Weka ARFF (attribute relation file format) file parser. ARFF is an ASCII text file format that is essentially a CSV file with a header that describes the meta-data. ARFF was developed for use in the Weka machine learning software.

    A dataset is firstly described, beginning with the name of the dataset (or the relation in ARFF terminology). Each of the variables (or attribute in ARFF terminology) used to describe the observations is then identified, together with their data type, each definition on a single line. The actual observations are then listed, each on a single line, with fields separated by commas, much like a CSV file.

    Missing values in an ARFF dataset are identified using the question mark '?'.

    Comments can be included in the file, introduced at the beginning of a line with a '%', whereby the remainder of the line is ignored.

    A significant advantage of the ARFF data file over the CSV data file is the meta data information.

    Also, the ability to include comments ensure we can record extra information about the data set, including how it was derived, where it came from, and how it might be cited.

    • Constructor Detail

      • ArffParser

        public ArffParser()
        Constructor.
    • Method Detail

      • getResponseIndex

        public int getResponseIndex()
        Returns the column index (starting at 0) of dependent/response variable.
      • setResponseIndex

        public ArffParser setResponseIndex(int index)
        Sets the column index (starting at 0) of dependent/response variable.
      • getAttributes

        public static Attribute[] getAttributes(java.net.URI uri)
                                         throws java.io.IOException,
                                                java.text.ParseException
        Returns the attribute set of given URI.
        Throws:
        java.io.IOException
        java.text.ParseException
      • getAttributes

        public static Attribute[] getAttributes(java.lang.String path)
                                         throws java.io.IOException,
                                                java.text.ParseException
        Returns the attribute set of given file.
        Throws:
        java.io.IOException
        java.text.ParseException
      • getAttributes

        public static Attribute[] getAttributes(java.io.File file)
                                         throws java.io.IOException,
                                                java.text.ParseException
        Returns the attribute set of given file.
        Throws:
        java.io.IOException
        java.text.ParseException
      • getAttributes

        public static Attribute[] getAttributes(java.io.InputStream stream)
                                         throws java.io.IOException,
                                                java.text.ParseException
        Returns the attribute set of given stream.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public AttributeDataset parse(java.net.URI uri)
                               throws java.io.IOException,
                                      java.text.ParseException
        Parse a dataset from given URI.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public AttributeDataset parse(java.lang.String path)
                               throws java.io.IOException,
                                      java.text.ParseException
        Parse a dataset from given file.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public AttributeDataset parse(java.io.File file)
                               throws java.io.IOException,
                                      java.text.ParseException
        Parse a dataset from given file.
        Throws:
        java.io.IOException
        java.text.ParseException
      • parse

        public AttributeDataset parse(java.io.InputStream stream)
                               throws java.io.IOException,
                                      java.text.ParseException
        Parse a dataset from given stream.
        Throws:
        java.io.IOException
        java.text.ParseException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.