Class ArffLoader

  • Direct Known Subclasses:
    MultiTargetArffLoader

    public class ArffLoader
    extends Object
    The Class ArffLoader. Loads an Arff file with sparse or dense format.
    • Constructor Detail

      • ArffLoader

        public ArffLoader​(Reader reader,
                          int size,
                          int classAttribute)
        Instantiates a new arff loader.
        Parameters:
        reader - the reader
        size - the size
        classAttribute - the class attribute
      • ArffLoader

        public ArffLoader​(Reader reader)
        Instantiates a new arff loader.
        Parameters:
        reader - the reader
      • ArffLoader

        public ArffLoader​(Reader reader,
                          Range range)
        Instantiates a new arff loader.
        Parameters:
        reader - the reader
        range - the range
    • Method Detail

      • getStructure

        public InstanceInformation getStructure()
        Gets the structure.
        Returns:
        the structure
      • readInstance

        public Instance readInstance()
        Reads instance. It detects if it is dense or sparse.
        Returns:
        the instance
      • readInstanceDense

        public Instance readInstanceDense()
        Reads a dense instance from the file.
        Returns:
        the instance
      • setValue

        protected void setValue​(Instance instance,
                                int numAttribute,
                                double value,
                                boolean isNumber)
      • newSparseInstance

        protected Instance newSparseInstance​(double d,
                                             double[] res)
      • newSparseInstance

        protected Instance newSparseInstance​(double d)
      • newDenseInstance

        protected Instance newDenseInstance​(int numberAttributes)