Types
Four types of drift:
- concept drift: change in P(y∣x), shift in relationship between input and target output. If we have real-time ground truth labels, change in performance is the strongest indicator
- prediction drift: change in P(y^∣x)
- label drift: change in P(y), shift in ground truth distribution
- feature drift: change in P(X)
"Virtual concept drift" has no influence on performance:
Causes
- externalities cause real change in data distribution
- data integrity issues due to data engineering or data collection
How to detect data drift?
No ground truth during inference, therefore cannot use performance metrics like AUC, precision, recall, etc...
Population Stability Index (PSI)
Mostly used in the financial industry
One training population and one scoring population. Divide each in say n equal buckets, denoted {B1D,…,BnD} where D is either the training or scoring dataset. For bucket i, let's denote Pit the percentage of training data in bucket Bitraining and Pis the percentage of training data in bucket Biscoring.
PSI=∑1≤i≤n(Pis−Pit)⋅lnPitPis
- PSI < 0.1: no significant population change
- 0.1 < PSI < 0.2: slight population change
- PSI >= 0.2: significant population change
Kullback-Leibler divergence
Average number of bits wasted by encodings events from P based on Q.
DKL(P∥Q)=∑x∈χP(x)logQ(x)P(x)
Standard values?
Jensen-Shannon divergence
Based on KL divergence, except it is symmetric and always has a finite value
JSD(P∥Q)=21DKL(P∥M)+21DKL(Q∥M),M=21(P+Q)
Kolmogorov-Smirnov test
Nonparametric test (does not assume a specific distribution)
Largest absolute difference between two distributions functions:
D=supx∣Ftraining(x)−Fscoring(x)∣
where the empirical distribution function for n i.i.d. samples is given by: F=∑xIXi∈(∞,x]
If the scoring distribution comes from the reference distribution: D→0 almost surely as n→∞
Recall: sequence Xn converges almost surely towards X if P(limn→∞Xn=X)=1
Frameworks
scikit-multiflow for streaming data.
Papers to read
- https://arxiv.org/pdf/1010.4784.pdf
- https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.2279&rep=rep1&type=pdf
- https://link.springer.com/chapter/10.1007/978-3-540-28645-5_29