GithubHelp home page GithubHelp logo

concept-drift's Introduction

AdWin: ADaptive sliding WINdow algorithm

Based on paper:

Bifet and R. Gavalda. 2007. Learning from Time-Changing Data with Adaptive Windowing

class concept_drift.adwin.AdWin(
    delta=0.002, max_buckets=5, min_clock=32, min_win_len=10, min_sub_win_len=5
)
Parameters
delta Confidence value
max_buckets Max number of buckets within one bucket row
min_clock Min number of new data for starting to reduce window and detect change
min_window_len Min window length for starting to reduce window and detect change
min_sub_window_len Min sub-window length, which is split from whole window

Methods

set_input(value)

Set input value to the drift detector - ADWIN.

Type Input - Output
Parameters value: Input value
Return Boolean: Whether has drift

Example

from concept_drift.adwin import AdWin

adwin = AdWin()
for i in range(1000):
    if adwin.set_input(i):
        print("Here is a drift")

Page-Hinckley Test

Based on Chapter 5.1:

Gama, J., Sebastião, R., & Rodrigues, P. P. (2013). On evaluating stream learning algorithms

class concept_drift.page_hinkley.PageHinkley(
    delta_=0.005, lambda_=50, alpha_=1 - 0.0001
)
Parameters
delta_ Magnitude of changes that are allowed
lambda_ Difference threshold
alpha_ Adaption variable for lambda adjustment

Methods

set_input(value)

Set input value to the drift detector - PageHinkley.

Type Input - Output
Parameters value: Input value
Return Boolean: Whether has drift

Test

Used the elecNormNew dataset;
Used GaussianNB as based classification;
Used accuracy_score as input date for change detector;
Used the prequential evaluation;

GaussianNB:
Mean acc within the window 1000: 0.7289912189511405

Page-Hinkley:
Drift detection: 8
Mean acc within the window 1000: 0.7342849306584686

AdWin:
Drift detection: 139
Mean acc within the window 1000: 0.7496421003738032

concept-drift's People

Contributors

blablahaha avatar yuqingwei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

concept-drift's Issues

Thanks for your code!

Thanks for your code!
But i want a regressor version,can you upload it?
I‘m very grateful.

Epsilon cut calculation

Hello,
while going through your code, I tried to understand the calculation of epsilon_cut. This is a code snippet from __reduce_expressions() function:

m = 1 / (n0 - self.min_length_sub_window + 1) + 1 / (n1 - self.min_length_sub_window + 1)
d = log(2 * log(self.width) / self.delta)
variance = self.variance / self.width
epsilon = sqrt(2 * m * variance * d) + 2 / 3 * m * d

I do not really understand how you come to the d value. In the original publication it is ln (2 / delta^' ). Maybe I am just not getting some easy part, but I don't see you switching ln to log and adding log to self.width.

(BTW, I agree on everything else)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.