Documentation of 'jsat.driftdetectors.DDM' Java class
DDM
jsat.driftdetectors

Class DDM<V>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public class DDM<V>
    extends BaseDriftDetector<V>
    DDM (Drift Detection Method) is a drift detector for binary events, and is meant to detect decreases in the success rate over time. As such it will not inform of any positive drift.

    This drift detector supports a warning state, and will not begin to store the object history until a warning state begins. If the warning state ends before a detection of drift occurs, the history will be dropped.
    See: Gama, J., Medas, P., Castillo, G.,&Rodrigues, P. (2004). Learning with Drift Detection. In A. C. Bazzan&S. Labidi (Eds.), Advances in Artificial Intelligence – SBIA 2004 (pp. 286–295). Springer Berlin Heidelberg. doi:10.1007/978-3-540-28645-5_29
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      DDM()
      Creates a new DDM drift detector using the default warning and drift thresholds of 2 and 3 respectively.
      DDM(DDM<V> toCopy)
      Copy constructor
      DDM(double warningThreshold, double driftThreshold)
      Creates a new DDM drift detector
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean addSample(boolean trial, V obj)
      Adds a new boolean trial to the detector, with the goal of detecting when the number of successful trials (true) drifts to a new value.
      boolean addSample(double value, V obj)
      Adds a new point to the drift detector.
      DDM<V> clone() 
      void driftHandled()
      This method should be called once the drift is handled.
      double getDriftThreshold()
      Returns the threshold multiple for controlling the false positive / negative rate on detecting changes.
      double getSuccessRate()
      Returns the current estimate of the success rate (number of true inputs) for the model.
      double getWarningThreshold()
      Returns the threshold multiple for controlling the false positive / negative rate on detecting changes.
      void setDriftThreshold(double driftThreshold)
      Sets the multiplier on the standard deviation that must be exceeded to recognize the change as a drift.
      void setWarningThreshold(double warningThreshold)
      Sets the multiplier on the standard deviation that must be exceeded to initiate a warning state.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DDM

        public DDM()
        Creates a new DDM drift detector using the default warning and drift thresholds of 2 and 3 respectively.
      • DDM

        public DDM(double warningThreshold,
                   double driftThreshold)
        Creates a new DDM drift detector
        Parameters:
        warningThreshold - the threshold for starting a warning state
        driftThreshold - the threshold for recognizing a drift
      • DDM

        public DDM(DDM<V> toCopy)
        Copy constructor
        Parameters:
        toCopy - the object to copy
    • Method Detail

      • getSuccessRate

        public double getSuccessRate()
        Returns the current estimate of the success rate (number of true inputs) for the model.
        Returns:
        the current estimate of the success rate
      • addSample

        public boolean addSample(boolean trial,
                                 V obj)
        Adds a new boolean trial to the detector, with the goal of detecting when the number of successful trials (true) drifts to a new value. This detector begins storing a history of the obj inputs only once it has entered a warning state.
        This detector is specifically meant to detect drops in the success rate, and will not cause any warning or drift detections for increases in the success rate.
        Parameters:
        trial - the result of the trial
        obj - the object to associate with the trial
        Returns:
        true if we are in a warning or drift state, false if we are not
      • setWarningThreshold

        public void setWarningThreshold(double warningThreshold)
        Sets the multiplier on the standard deviation that must be exceeded to initiate a warning state. Once in the warning state, DDM will begin to collect a history of the inputs
        Increasing the warning threshold makes it take longer to start detecting a change, but reduces false positives.
        If the warning threshold is set above the setDriftThreshold(double), the drift state will not occur until the warning state is reached, and the warning state will be skipped.
        Parameters:
        warningThreshold - the positive multiplier threshold for starting a warning state
      • getWarningThreshold

        public double getWarningThreshold()
        Returns the threshold multiple for controlling the false positive / negative rate on detecting changes.
        Returns:
        the threshold multiple for controlling warning detection
      • setDriftThreshold

        public void setDriftThreshold(double driftThreshold)
        Sets the multiplier on the standard deviation that must be exceeded to recognize the change as a drift.
        Increasing the drift threshold makes it take longer to start detecting a change, but reduces false positives.
        Parameters:
        driftThreshold - the positive multiplier threshold for detecting a drift
      • getDriftThreshold

        public double getDriftThreshold()
        Returns the threshold multiple for controlling the false positive / negative rate on detecting changes.
        Returns:
        the threshold for controlling drift detection
      • addSample

        public boolean addSample(double value,
                                 V obj)
        Description copied from class: BaseDriftDetector
        Adds a new point to the drift detector. If an escalation in state occurs, true will be returned. A change of state could be either drift occurring BaseDriftDetector.isDrifting() or a warning state BaseDriftDetector.isWarning(). If the detector was in a warning state and then goes back to normal, false will be returned.

        For binary (true / false) drift detectors, value will be considered false if and only if its value is equal to zero. Any non zero value will be treated as true

        Objects added with the value may or may not be added to the history, the behavior is algorithm dependent. Some may always add it to the history, while others will only begin collecting history once a warning state occurs.
        Specified by:
        addSample in class BaseDriftDetector<V>
        Parameters:
        value - the numeric value to add to the drift detector
        obj - the object associated with this value. It may or may not be stored in the detectors history
        Returns:
        true if a drift has or may be starting.
      • driftHandled

        public void driftHandled()
        Description copied from class: BaseDriftDetector
        This method should be called once the drift is handled. Once done, this method will clear the flags and prepare the detector to continue tracking drift again.
        By using this method, one can continue to track multiple future drift changes without having to feed the history data (which may be incomplete) into a new detector object.
        Overrides:
        driftHandled in class BaseDriftDetector<V>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.