Class SineGenerator

  • All Implemented Interfaces:
    Configurable, Serializable, CapabilitiesHandler, MOAObject, OptionHandler, ExampleStream<Example<Instance>>, InstanceStream

    public class SineGenerator
    extends AbstractOptionHandler
    implements InstanceStream
    1.SINE1. Abrupt concept drift, noise-free examples. It has two relevant attributes. Each attributes has values uniformly distributed in [0; 1]. In the first context all points below the curve y = sin(x) are classified as positive. After the context change the classification is reversed. 2.SINE2. The same two relevant attributes. The classification function is y < 0.5 + 0.3 sin(3 * PI * x). After the context change the classification is reversed. 3.SINIRREL1. Presence of irrelevant attributes. The same classification function of SINE1 but the examples have two more random attributes with no influence on the classification function. 4.SINIRREL2. The same classification function of SINE2 but the examples have two more random attributes with no influence on the classification function. Based on proposal by "Gama, Joao, et al. "Learning with drift detection." Advances in artificial intelligence–SBIA 2004. Springer Berlin Heidelberg, 2004. 286-295."
    Version:
    $Revision: 1 $
    Author:
    Paulo Gonçalves (paulogoncalves@recife.ifpe.edu.br)
    See Also:
    Serialized Form
    • Field Detail

      • NUM_IRRELEVANT_ATTRIBUTES

        public static final int NUM_IRRELEVANT_ATTRIBUTES
        See Also:
        Constant Field Values
      • instanceRandomSeedOption

        public IntOption instanceRandomSeedOption
      • functionOption

        public IntOption functionOption
      • suppressIrrelevantAttributesOption

        public FlagOption suppressIrrelevantAttributesOption
      • balanceClassesOption

        public FlagOption balanceClassesOption
      • instanceRandom

        protected Random instanceRandom
      • nextClassShouldBeZero

        protected boolean nextClassShouldBeZero
    • Constructor Detail

      • SineGenerator

        public SineGenerator()
    • Method Detail

      • 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
      • 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<Example<Instance>>
        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<Example<Instance>>
        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<Example<Instance>>
        Returns:
        true if this stream has more instances to output
      • 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