Package weka.djl

Class InstancesDataset

  • All Implemented Interfaces:
    ai.djl.training.dataset.Dataset

    public class InstancesDataset
    extends ai.djl.basicdataset.tabular.TabularDataset
    InstancesDataset represents the dataset that is stored in an .arff[.gz] file. Only supports NUMERIC, NOMINAL, STRING and DATE attributes. By default, DATE and STRING attributes get ignored. DATE attributes can be treated as NUMERIC ones: get parsed and the epoch time is stored as NUMERIC string. STRING attributes can be treated as NOMINAL ones. Ignored columns, explicit or via regexps, should be set first.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  InstancesDataset.InstancesBuilder<T extends InstancesDataset.InstancesBuilder<T>>
      Used to build a InstancesDataset.
      • Nested classes/interfaces inherited from class ai.djl.basicdataset.tabular.TabularDataset

        ai.djl.basicdataset.tabular.TabularDataset.BaseBuilder<T extends ai.djl.basicdataset.tabular.TabularDataset.BaseBuilder<T>>
      • Nested classes/interfaces inherited from interface ai.djl.training.dataset.Dataset

        ai.djl.training.dataset.Dataset.Usage
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected weka.core.Instances data  
      protected com.google.gson.JsonObject structure  
      • Fields inherited from class ai.djl.basicdataset.tabular.TabularDataset

        features, labels
      • Fields inherited from class ai.djl.training.dataset.RandomAccessDataset

        dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected long availableSize()
      static InstancesDataset.InstancesBuilder<?> builder()
      Creates a builder to build a InstancesDataset.
      String getCell​(long rowIndex, String featureName)
      weka.core.Instances getData()
      Returns the underlying data.
      void prepare​(ai.djl.util.Progress progress)
      String toInfo()
      Generates a string with information about the features/labels.
      com.google.gson.JsonObject toJson()
      Returns the feature/labels as json.
      void toJson​(Path filename)
      Writes the features/labels JSON representation to the specified path.
      • Methods inherited from class ai.djl.basicdataset.tabular.TabularDataset

        get, getFeatures, getFeatureSize, getLabels, getLabelSize, getRowDirect, getRowFeatures, matchingTranslatorOptions, prepareFeaturizers
      • Methods inherited from class ai.djl.training.dataset.RandomAccessDataset

        getData, getData, getData, getData, newSubDataset, newSubDataset, randomSplit, size, subDataset, subDataset, subDataset, subDataset, toArray
      • Methods inherited from interface ai.djl.training.dataset.Dataset

        prepare
    • Field Detail

      • data

        protected weka.core.Instances data
      • structure

        protected com.google.gson.JsonObject structure
    • Method Detail

      • getCell

        public String getCell​(long rowIndex,
                              String featureName)
        Specified by:
        getCell in class ai.djl.basicdataset.tabular.TabularDataset
      • availableSize

        protected long availableSize()
        Specified by:
        availableSize in class ai.djl.training.dataset.RandomAccessDataset
      • getData

        public weka.core.Instances getData()
        Returns the underlying data.
        Returns:
        the wrapped data
      • toInfo

        public String toInfo()
        Generates a string with information about the features/labels.
        Returns:
        the info
      • toJson

        public com.google.gson.JsonObject toJson()
        Returns the feature/labels as json.
        Returns:
        the generated json
      • toJson

        public void toJson​(Path filename)
                    throws IOException
        Writes the features/labels JSON representation to the specified path.
        Parameters:
        filename - the file to write the representation to
        Throws:
        IOException - if writing fails