Package moa.streams

Class PartitioningStream

    • Field Detail

      • partitionIndexOption

        public IntOption partitionIndexOption
      • numPartitionsOption

        public IntOption numPartitionsOption
      • randomSeedOption

        public IntOption randomSeedOption
      • partitionIndex

        protected int partitionIndex
      • numPartitions

        protected int numPartitions
      • random

        protected Random random
    • Constructor Detail

      • PartitioningStream

        public PartitioningStream()
    • Method Detail

      • getHeader

        public InstancesHeader getHeader()
        Description copied from interface: ExampleStream
        Gets the header of this stream. This is useful to know attributes and classes. InstancesHeader is an extension of weka.Instances.
        Specified by:
        getHeader in interface ExampleStream
        Returns:
        the header of this stream
      • estimatedRemainingInstances

        public long estimatedRemainingInstances()
        Description copied from interface: ExampleStream
        Gets the estimated number of remaining instances in this stream
        Specified by:
        estimatedRemainingInstances in interface ExampleStream
        Returns:
        the estimated number of instances to get from this stream
      • hasMoreInstances

        public boolean hasMoreInstances()
        Description copied from interface: ExampleStream
        Gets whether this stream has more instances to output. This is useful when reading streams from files.
        Specified by:
        hasMoreInstances in interface ExampleStream
        Returns:
        true if this stream has more instances to output
      • isRestartable

        public boolean isRestartable()
        Description copied from interface: ExampleStream
        Gets whether this stream can restart.
        Specified by:
        isRestartable in interface ExampleStream
        Returns:
        true if this stream can restart
      • restart

        public void restart()
        Description copied from interface: ExampleStream
        Restarts this stream. It must be similar to starting a new stream from scratch.
        Specified by:
        restart in interface ExampleStream
      • getDescription

        public void getDescription​(StringBuilder sb,
                                   int indent)
        Description copied from interface: MOAObject
        Returns a string representation of this object. Used in AbstractMOAObject.toString to give a string representation of the object.
        Specified by:
        getDescription in interface MOAObject
        Parameters:
        sb - the stringbuilder to add the description
        indent - the number of characters to indent
      • prepareForUseImpl

        protected void prepareForUseImpl​(TaskMonitor monitor,
                                         ObjectRepository repository)
        Description copied from class: AbstractOptionHandler
        This method describes the implementation of how to prepare this object for use. All classes that extends this class have to implement prepareForUseImpl and not prepareForUse since prepareForUse calls prepareForUseImpl.
        Specified by:
        prepareForUseImpl in class AbstractOptionHandler
        Parameters:
        monitor - the TaskMonitor to use
        repository - the ObjectRepository to use
      • getNextPartitionToLeaveOut

        protected int getNextPartitionToLeaveOut()
        get the partition which is excluded from seeing the next instance
        Returns:
        the index of the excluded partition
      • isNextInstanceFromPartition

        protected boolean isNextInstanceFromPartition()
        check if this stream is excluded from seeing the next instance
        Returns:
      • discardNexInstancesNotFromPartition

        protected void discardNexInstancesNotFromPartition()
        discarding all instances which are exluded until an instance which can be seen by this stream or the stream is empty