## 3 Proposed Algorithms
### Variance Feedback Drift Detection Method
Lines 16-18 describe the drift detection process: when the difference between the current mean \(p\) and the maximum mean \(p_{max}\) is significant, VFDDM issues a drift warning and performs a reset operation. Lines 19-23 describe the reset operation of VFDDM when a drift warning occurs, including mean reset, variance reset, base classifier reset, and drift status reset. ```
Input: Stream--\(S\), Window--\(\mathit{win}\), Variance pool--\(\mathit{vp}\), Confidence level--\(\delta\), Initial weighting factor--\(\mathit{diff}_{0}\) Output:\(\mathit{Diff}_{\_Status}\)
1 while\(S\) has a new instance \(S_{i}\)do
2 Insert prediction(\(S_{i}\)) into \(\mathit{win}\)
3 Forget the oldest instance in \(\mathit{win}\)
4 Calculate \(\mathit{diff}\) by Equation (10)
5 Calculate \(p\) by Equation (11)
6 Update \(p_{max}\) by Equation (22)
7 Calculate \((\varepsilon_{\mathit{S}})_{\min}\) by Equation (6)
8 if\(p_{max}-p\leq(\varepsilon_{\mathit{S}})_{\min}\)do
9 Add prediction(\(S_{i}\)) to \(\mathit{vp}\)
10 Update variance \(\sigma^{2}\) by Equation (9)
11 Calculate critical variance \(\sigma_{c}^{2}\) by Equation (13)
12 if\(\sigma^{2}\leq\sigma_{c}^{2}\)do
13\(\varepsilon\leftarrow\mathit{Bernstein\ Test}()\)
14 else
15\(\varepsilon\leftarrow\mathit{other\ Test}\)
16 if\(p_{max}-p>\varepsilon\)do
17\(\mathit{Diff}_{\_Status}\leftarrow\mathbf{True}\)
18 Reset()
19 def_Reset()
20 Reset \(p\gets p_{\_}{\_}{\max}\)\(\leftarrow\)0
21 Reset \(\sigma^{2}\leftarrow\sigma_{c}^{2}\)
22 Reset Base classifier
23 Reset \(\mathit{Drif}_{\_Status}\leftarrow\mathbf{False}\)
```  
**Algorithm 1** Variance Feedback Drift Detection Method (VFDDM)  
Algorithm 2 provides the statistical test methods required for VFDDM. These methods all require two parameters as input: the confidence level \(\delta\) and the window size \(n\). They also return a significance threshold (Lines 4, 7, 12, and 19) for drift detection. Lines 1-4 describe the Bernstein test, which is used for cases with smaller variances. This test requires the data stream variance as an additional input parameter (line 2), and then calculates the significance threshold according to Equation (4) and returns it (lines 3-4). Lines 5-19 introduce the statistical test methods applicable for situations with larger variances, including the Hoeffding test (lines 5-7), the McDiarmid test (lines 8-12), and the Kolmogorov test (lines 13-19). The McDiarmid test requires additional calculation of the sum of squared weights (line 10), while the significance threshold for the Kolmogorov test cannot be directly computed and needs to be obtained through binary search approximation for an approximate solution (lines 17-18). Therefore, an approximate precision \(ap\) is required as an additional input (line 14). At the same time, since the objective of the Kolmogorov test is Bernoulli random variables, the weighted mean should be restored to the mean based on the Bernoulli distribution (Line 15 and Equation (11)). ```
Input: Confidence level--\(\delta\), Size of window--\(n\) Output: Significance threshold--\(\epsilon\) Lower Variance--Bernstein Test
1 def Bernstein Test()
2 Extra input: Variance--\(\sigma^{2}\) Calculate \(\epsilon_{B}\) by Equation (4) Return \(\epsilon_{B}\) Higher Variance--Other Tests
3 def Hoeffding Test()
4 Calculate \(\epsilon_{H}\) by Equation (12) Return \(\epsilon_{H}\)
5 def McDiarmid Test()
6 Extra input: Weighting factor--_diff_ Calculate sigma by Equation (19)
7 Calculate \(\epsilon_{M}\) by Equation (18) Return \(\epsilon_{M}\)
8 def Kolmogorov Test()
9 Extra input: Approximate precision--\(ap\), Mean--\(p\), Max of mean--\(p_{max}\) Reverse solving for original \(p\) and \(p_{max}\) using Equation (11). 10 Find the equation \(E\) which satisfied \(\epsilon_{K}\) according to Equation (21). 11 whileprecision(\(\epsilon_{K}\)) > \(ap\)do
12 Binary search approximation for solving \(E\) Return \(\epsilon_{K}\)
```  
**Algorithm 2** Statistical Tests for VFDDM