ai.libs.jaicore.ml.cache

Class ReproducibleInstances

  • java.lang.Object
    • java.util.AbstractCollection<E>
      • java.util.AbstractList<weka.core.Instance>
        • weka.core.Instances
          • ai.libs.jaicore.ml.cache.ReproducibleInstances
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<weka.core.Instance>, java.util.Collection<weka.core.Instance>, java.util.List<weka.core.Instance>, weka.core.RevisionHandler


    public class ReproducibleInstancesextends weka.core.Instances
    New Instances class to track splits and data origin. Origin of the dataset is stored by a LoadDataSetInstruction and changed by FoldBasedSubsetInstructions saved as a list of instructions. This history of the instances can be converted to json and used to reproduce a specific set of instances.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class weka.core.Instances

        ARFF_DATA, ARFF_RELATION, FILE_EXTENSION, m_Attributes, m_ClassIndex, m_Instances, m_Lines, m_NamesToAttributeIndices, m_RelationName, SERIALIZED_OBJ_FILE_EXTENSION
      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddInstruction(Instruction i)
      Adds a new Instruction to the history of these Instances
      static ReproducibleInstancesfromARFF(java.lang.String path)
      Creates a new ReproducibleInstances object.
      static ReproducibleInstancesfromHistory(java.util.List<Instruction> history, java.lang.String apiKey)
      Creates a ReproducibleInstances Object based on the given History.
      static ReproducibleInstancesfromOpenML(java.lang.String id, java.lang.String apiKey)
      Creates a new ReproducibleInstances object.
      java.util.List<Instruction>getInstructions() 
      booleanisCacheLookup()
      If true signifies that performance on this data should be looked up in cache
      booleanisCacheStorage()
      If true signifies that performance evaluation should be stored.
      voidsetCacheLookup(boolean cacheLookup)
      If true signifies that performance on this data should be looked up in cache
      voidsetCacheStorage(boolean cacheStorage)
      If set to true, signifies that performance evaluation should be stored.
      • Methods inherited from class weka.core.Instances

        add, add, allAttributeWeightsIdentical, allInstanceWeightsIdentical, attribute, attribute, attributeStats, attributeToDoubleArray, checkForAttributeType, checkForStringAttributes, checkInstance, classAttribute, classIndex, compactify, copyInstances, delete, delete, deleteAttributeAt, deleteAttributeType, deleteStringAttributes, deleteWithMissing, deleteWithMissing, deleteWithMissingClass, enumerateAttributes, enumerateInstances, equalHeaders, equalHeadersMsg, firstInstance, get, getRandomNumberGenerator, getRevision, initialize, insertAttributeAt, instance, instancesAndWeights, kthSmallestValue, kthSmallestValue, lastInstance, main, meanOrMode, meanOrMode, mergeInstances, numAttributes, numClasses, numDistinctValues, numDistinctValues, numInstances, randomize, readInstance, relationName, remove, renameAttribute, renameAttribute, renameAttributeValue, renameAttributeValue, replaceAttributeAt, resample, resampleWithWeights, resampleWithWeights, resampleWithWeights, resampleWithWeights, resampleWithWeights, resampleWithWeights, resampleWithWeights, set, setAttributeWeight, setAttributeWeight, setClass, setClassIndex, setRelationName, size, sort, sort, sortBasedOnNominalAttribute, stableSort, stableSort, stratify, stratStep, stringFreeStructure, stringWithoutHeader, sumOfWeights, swap, test, testCV, toString, toSummaryString, trainCV, trainCV, variance, variance, variances
      • Methods inherited from class java.util.AbstractList

        addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Method Detail

      • fromHistory

        public static ReproducibleInstances fromHistory(java.util.List<Instruction> history,                                                java.lang.String apiKey)                                         throws java.io.IOException
        Creates a ReproducibleInstances Object based on the given History. Instructions that no not modify the Instances will be ignored (No evaluation will be done).
        Parameters:
        history - List of Instructions used to create the original Instances
        apiKey - apiKey in case openml.org is used
        Returns:
        new ReproducibleInstances object
        Throws:
        java.io.IOException - if something goes wrong while loading Instances from openml or when reading arff file
      • fromOpenML

        public static ReproducibleInstances fromOpenML(java.lang.String id,                                               java.lang.String apiKey)                                        throws java.io.IOException
        Creates a new ReproducibleInstances object. Data is loaded from openml.org.
        Parameters:
        id - The id of the openml dataset
        apiKey - apikey to use
        Returns:
        new ReproducibleInstances object
        Throws:
        java.io.IOException - if something goes wrong while loading Instances from openml
      • fromARFF

        public static ReproducibleInstances fromARFF(java.lang.String path)                                      throws java.io.IOException
        Creates a new ReproducibleInstances object. Data is loaded from a local arff file.
        Parameters:
        path - path to the dataset
        Returns:
        new ReproducibleInstances object
        Throws:
        java.io.IOException - if the ARFF file is not read successfully
      • getInstructions

        public java.util.List<Instruction> getInstructions()
        Returns:
        the ordered lists of instructions or null if cache is not used
      • addInstruction

        public void addInstruction(Instruction i)
        Adds a new Instruction to the history of these Instances
        Parameters:
        i - - new Instruction
      • isCacheStorage

        public boolean isCacheStorage()
        If true signifies that performance evaluation should be stored.
        Returns:
        true if performance should be saved
      • setCacheStorage

        public void setCacheStorage(boolean cacheStorage)
        If set to true, signifies that performance evaluation should be stored.
        Parameters:
        cacheStorage - the cacheStorage to set
      • isCacheLookup

        public boolean isCacheLookup()
        If true signifies that performance on this data should be looked up in cache
        Returns:
        true if lookup should be performed
      • setCacheLookup

        public void setCacheLookup(boolean cacheLookup)
        If true signifies that performance on this data should be looked up in cache
        Parameters:
        cacheLookup - the cacheLookup to set


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14