# Fast Reaction to Sudden Concept Drift in the Absence of Class Labels
## 3 The Proposed Approach
### The DMDDM-S Algorithm  
The DMDDM-S approach is presented in Algorithm 1 and its framework is shown in Figure 3. First, the algorithm processes each example from the data stream and obtains the predictions for a pair of classifiers on each example line (lines 1-3). Then, the algorithm builds the outputs, as shown in Table 1. As shown in Table 1, we need to find the two cases (\(N^{10}\) and \(N^{01}\)) where the pair of classifiers performs differently. Once we observe this disagreement, we count the number of observations on which one classifier is correct and the other is incorrect, shown in lines 4 to 9, respectively. These steps represent the first phase of the DMDDM-S framework (prediction phase). Phase two (concept drift detection phase) uses these observed predictions using a disagreement measure with the PH test to detect drifts. In line 10, we apply the disagreement measure (Equation (1)) by aggregating these observations and dividing it by the number of component classifiers. Then, the fading factor approach is applied from lines 11 to 13 (Equation (5), Equation (3) and Equation (6)). In lines 11 and 12, the fading sum and fading increment are calculated, respectively. With the fading sum and fading increment, we use the value of diversity from line 10 as the observed value instead of the error estimates that were used in the original PH test. In line 13, the fading average is calculated. To monitor the diversity of a pair of classifiers from lines 14 to 19, the modified PH test considers a variable \(m_{T}\), which measures the accumulated difference between the observed value of diversity and their mean up to the current moment (Equation (7)). After each observation, the PH test checks whether the difference between the current \(m_{T}\) and the smallest value up to this moment \(M_{T}\) is greater than a given threshold (Equation (9)). If the difference exceeds the predefined threshold, a drift is signalled. When there is a drift, we need to label the current unlabelled data to use them to retrain the model and keep it consistent. Therefore, line 20 combines the two windows of the labelled (\(W_{ld}\)) and unlabelled data (\(W_{uld}\)) and sends the result to K-prototype clustering in order to label the unlabelled data in line 21, the third phase of the DMDDM-S framework. When there is a drift, phase four (drift understanding) starts, which evaluates the detected drift in terms of delay detection, true detection, false alarm and false negative. The evaluation method is explained in Figure 4.  
Then, lines (22-24) incrementally train the current model and keep it up-to-date with the newly labelled data (\(N_{ld}\)). Lines (26-39) check and handle the availability of each class, phase five (class is missing?). With each observation of \(x^{t}\) and whether there is a drift or not, we need to check if \(x^{t}\) is labelled or not. If the class of \(x^{t}\) is missing, first line 27 checks if (\(W_{uld}\)) reached the pre-defined probability, removes the oldest instance in (\(W_{uld}\)) and adds the newest one to (\(W_{uld}\)); otherwise, \(x^{t}\) is added to (\(W_{uld}\)) directly, line 30. On the other hand, if the class is not missing, line 33 will incrementally train the current model with the current labelled instance. Finally, lines (35-39) check the dynamic window of labelled data (\(W_{ld}\)). If the size of this window reaches the pre-defined probability, we start removing the oldest one and add the newest labelled; otherwise, \(x^{t}\) is added to (\(W_{ld}\)).