Skip to main content

Drift

ADWINโ€‹

Calculates Drift using the Adaptive Windowing method for concept drift detection.

from katonic.drift.adwin import ADWIN

ad = ADWIN()
ad.fit(train_set)
predictions = ad.predict(test_set.iloc[index_no])
# predictions consist of list of dictionary per columnwise
# for each column we have
[{'Is drift': Bool value,
'Is warning': Bool value,
'Variance of window': float value,
'No of Detections': int value,
'Mean of widow': float value,
'Column name or number': column name}]]

DDMโ€‹

Calculates Drift using the Drift Detection Method (DDM).

from katonic.drift.ddm import DDM

ddm = DDM()
ddm.fit(train_set)
predictions = ddm.predict(test_set.iloc[index_no])
# predictions consist of list of dictionary per columnwise
# for each column we have
[{'Is drift': Bool value,
'Is warning': Bool value]]

EDDMโ€‹

Calculates Early Drift using the Early Drift Detection Method (EDDM).

from katonic.drift.eddm import EDDM

ed = EDDM()
ed.fit(train_set)
predictions = ddm.predict(test_set.iloc[index_no])
# predictions consist of list of dictionary per columnwise
# for each column we have
[{'Is drift': Bool value,
'Is warning': Bool value]]

HDDM_Aโ€‹

Calculates Drift using Drift Detection Method based on Hoeffding's bounds with moving average-test. """


from katonic.drift.hddm_a import HDDM_A

hddm_a = HDDM_A()
hddm_a.fit(train_seet)
predictions = hddm_a.predict(test_set.iloc[index_no])
# predictions consist of list of dictionary per columnwise
# for each column we have
[{'Is drift': Bool value,
'Is warning': Bool value]]

HDDM_Wโ€‹

Calculates Drift using Drift Detection Method based on Hoeffding's bounds with moving weighted average-test.

from katonic.drift.hddm_w import HDDM_W

hddm_w = HDDM_W()
hddm_w.fit(train_seet)
predictions = hddm_w.predict(test_set.iloc[index_no])
# predictions consist of list of dictionary per columnwise
# for each column we have
[{'Is drift': Bool value,
'Is warning': Bool value]]

KSWINโ€‹

Calculates Drift using Kolmogorov-Smirnov Windowing method for concept drift detection.

from katonic.drift.kswin import KSWIN

kswin = KSWIN()
kswin.fit(train_set)
predictions = kswin.predict(test_set.iloc[index_no])
# predictions consist of list of dictionary per columnwise
# for each column we have
[{'Is drift': Bool value,
'Is warning': Bool value,
'p_value': float value,
'Column name or number': column name}]]

PAGE HINKLEYโ€‹

Calculates Drift using Page-Hinkley method for concept drift detection.

from katonic.drift.page_hinkley import PageHinkley

ph = PageHinkley()
ph.fit(train_set)
predictions = ph.predict(test_set.iloc[index_no])
# predictions consist of list of dictionary per columnwise
# for each column we have
[{'Is drift': Bool value,
'Threshold': float value,
'Sum': float value,
'Column name or number': column name}]]

TARGET DRIFT with pSIโ€‹

Calculates the Population Stability Index (PSI) for target variables.

from katonic.drift.target_drift import PSI

psi = PSI()
psi.fit(X_train)
predictions = psi.predict(test_set)

TARGET DRIFT with CSIโ€‹

Calculates CSI score for all the columns fed to model, used when PSI score>=0.2

from katonic.drift.target_drift import CSI

csi = CSI()
csi.fit(train_set)
predictions = psi.predict(test_set)
## Predictions is a dictionary of columns:psi score