public class ADWIN<V> extends BaseDriftDetector<V>
double
values passed when calling
addSample(double, java.lang.Object)
. The object paired with the
numeric value will not be compressed and is added to on every update.
It is important to control its size using BaseDriftDetector.setMaxHistory(int)
when
using ADWIN. By default, ADWIN will use a maximum history of 0. drifting, driftStart, history, maxHistory, time, warning
Constructor and Description |
---|
ADWIN(ADWIN<V> toCopy)
Copy constructor
|
ADWIN(double delta)
Creates a new ADWIN object for detecting changes in the mean value of a
stream of inputs.
|
ADWIN(double delta,
int maxHistory)
Creates a new ADWIN object for detecting changes in the mean value of a
stream of inputs.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addSample(double value,
V obj)
Adds a new point to the drift detector.
|
ADWIN<V> |
clone() |
void |
driftHandled()
This method should be called once the drift is handled.
|
void |
driftHandled(boolean dropOld)
This implementation of ADWIN allows for choosing to drop either the old
values, as is normal for a drift detector, or to drop the newer
values.
|
double |
getDelta()
Returns the upper bound on false positives
|
int |
getM()
Returns the accuracy / speed parameter for ADWIN
|
double |
getMean()
Returns the mean value for all inputs contained in the current window
|
double |
getNewMean()
Returns the mean value determined for the newer values that we have
drifted into.
|
double |
getNewStndDev()
Returns the standard deviation for the newer values that we have
drifted into.
|
double |
getNewVariance()
Returns the variance for the newer values that we have
drifted into.
|
double |
getOldMean()
Returns the mean value determined for the older values that we have
drifted away from.
|
double |
getOldStndDev()
Returns the standard deviation for the older values that we have
drifted away from.
|
double |
getOldVariance()
Returns the variance for the older values that we have
drifted away from.
|
double |
getStndDev()
Returns the standard deviation for all inputs contained in the current
window.
|
double |
getVariance()
Returns the variance for all inputs contained in the current window
|
int |
getWidnowLength()
This returns the current "length" of the window, which is the number of
items that have been added to the ADWIN object since the last drift, and
is reduced when drift occurres.
|
void |
setDelta(double delta)
Sets the upper bound on the false positive rate for detecting concept
drifts
|
void |
setM(int M)
This parameter controls the trade off of space and accuracy for the
sliding window.
|
addToHistory, clearHistory, getDriftAge, getDriftedHistory, getMaxHistory, isDrifting, isWarning, setMaxHistory
public ADWIN(double delta)
delta
- the desired false positive ratepublic ADWIN(double delta, int maxHistory)
delta
- the desired false positive ratemaxHistory
- the maximum history of objects to keeppublic void setDelta(double delta)
delta
- the upper bound on false positives in (0,1)public double getDelta()
public void setM(int M)
M
becomes, the more accurate the
window will be - but at the cost of execution speed.M
- the window space constant in [1, ∞)public int getM()
public boolean addSample(double value, V obj)
BaseDriftDetector
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. value
will be
considered false
if and only if its value is equal to zero. Any
non zero value will be treated as true
addSample
in class BaseDriftDetector<V>
value
- the numeric value to add to the drift detectorobj
- the object associated with this value. It may or may not be
stored in the detectors historytrue
if a drift has or may be starting.public double getMean()
public double getVariance()
public double getStndDev()
public int getWidnowLength()
public double getOldMean()
Double.NaN
will be returned.public double getOldVariance()
Double.NaN
will be returned.public double getOldStndDev()
Double.NaN
will be returned.public double getNewMean()
Double.NaN
will be returned.public double getNewVariance()
Double.NaN
will be returned.public double getNewStndDev()
Double.NaN
will be returned.public void driftHandled(boolean dropOld)
true
will result in the standard behavior of
calling driftHandled()
. false
is passed in to drop the newer values that
drifted it is probably that continuing to add new examples will continue
to cause detections.dropOld
- true
to drop the older values out of the window
that we drifted away from, or false
to drop the newer values and
retain the old ones.public void driftHandled()
BaseDriftDetector
driftHandled
in class BaseDriftDetector<V>
public ADWIN<V> clone()
clone
in class BaseDriftDetector<V>
Copyright © 2017. All rights reserved.