## 3 Proposed Algorithms
### Variance Estimation  
Among concept drift detection methods, small-scale windows have greater advantages in abrupt drift detection. For example, FHDDM [6], MDDM [16] and BDDM [18] all use smaller windows to reduce detection delays. This research hopes to obtain the data stream variance on a small-scale window and characterize the data stream stability to a certain extent, so as to adopt personalized drift detection solutions for data streams with different characteristics. However, under small-scale window conditions, small sample effects will be faced. That is, when the window saves the classification results, if the window size is small, the prediction results in the window are likely to be all correct, and the window sample variance is 0 at this time. Obviously, the window variance cannot represent the overall variance of the data stream at this time. This is the problem that small-scale samples bring to variance estimation. In response to the above problem, this study proposes a fast variance estimation strategy under small-scale window conditions to estimate the overall variance of the data stream. This strategy is divided into two phases: **Variance sample collection** and **Rapid variance estimation**. **Phase 1. ** Variance sample collection  
In the sample collection stage, the Bernstein test is used as the basis for collecting variance sample points. The Bernstein test is a test method that depicts the upper bound of the difference between the observed mean and the actual mean, and also takes into account the impact of sample variance. Therefore, this test is suitable for environments involving sample variance. This test is based on [PERSON]'s inequality [19]:  
**[PERSON]'s inequality**--_Let \(X_{1}\), \(X_{2}\),..., \(X_{n}\) be \(n\) independent random variables located in the interval [0,1], with the variance is \(\sigma^{2}\) and any \(\varepsilon_{B}>0\). Then,_  
\[\Pr\left(\left|\frac{1}{n}\sum_{i=1}^{n}X_{i}-E[X]\right|>\varepsilon_{B} \right)\leq 2\exp\left(\frac{-n\varepsilon_{B}^{2}}{2\sigma^{2}+2\varepsilon_{ B}/3}\right) \tag{2}\]  
The significance confidence level \(\delta\) generated by this inequality can be expressed as Equation (3). \[\delta\ =\ \exp\left(\frac{-n\varepsilon_{B}^{2}}{2\sigma^{2}+2\varepsilon_{ B}/3}\right) \tag{3}\]  
Therefore, when the significance confidence level \(\delta\) is given, the mean significant difference threshold \(\varepsilon_{B}\) can be expressed as Equation (4). \[\varepsilon_{B}\ =\ \frac{1}{3}t+\sqrt{\frac{1}{9}t^{2}+2t\sigma^{2}} \tag{4}\]  
\[t\ =\ \frac{1}{n}\ln\frac{1}{\delta} \tag{5}\]  
Equation (4) gives the threshold calculation method of the Bernstein test. The threshold is affected by the real-time variance of the sample and can be used as the basis for detecting significant changes in the sample. In the variance sample collection stage, the minimum Bernstein bound is used as the minimum standard for variance sample collection. The minimum Bernstein bound can be calculated by Equation (4) and expressed as Equation (6). \[\left(\varepsilon_{B}\right)_{min}\ =\ \left.\varepsilon_{B}\right|_{\sigma^{2} =\ 0}\ =\ \frac{2\ln\delta^{-1}}{3n} \tag{6}\]  
The variance sample collection we proposed is based on the minimum Bernstein bound. When the difference between the current window mean \(p\) and the historical maximum mean \(p_{max}\) is within the minimum Bernstein bound \(\left(\varepsilon_{B}\right)_{min}\), the data stream is considered stable and meets the variance sample collection conditions. This condition can be described as the Equation (7). \[p>p_{max}-\left(\varepsilon_{B}\right)_{min} \tag{7}\]  
When the window mean \(p\) satisfies Equation (7), the variance estimation strategy will collect the latest data point \(X_{n-1}\) in the current window as a sample for variance calculation. In practical situations, the probability of having a data stream variance of 0 is virtually nonexistent.