# An Adaptive Active Learning Method for Multiclass Imbalanced Data Streams with Concept Drift
## 3 The Proposed AdaAL-MID Algorithm
### Overall Framework and Process of the AdaAL-MID  
This section presents the framework and workflow of the proposed adaptive active learning algorithm. The algorithm framework, as shown in Figure 2, consists of an ensemble classifier, an ADWIN detector for drift detection, and an instance sliding window for ensemble updating. The working steps of the AdaAL-MID are as follows:  
1. For each new incoming instance, the ensemble classifier first predicts it and outputs the prediction result. 2. Enter the mixed label request strategy; if the label request strategy is met and the label budget is sufficient, then request the true label. Otherwise, if the label request strategy is not met or the label budget is insufficient, proceed to the next instance. 3. Combine the true label with the instance to form a new training instance, and store the new training instance into the corresponding sliding window according to the label. Update the ensemble classifier online through the adaptive sampling strategy and the weighted ensemble strategy. 4. If the drift detector ADWIN detects a change, create a new base classifier, and sort the instances in the instance sliding window by time to form an instance sequence for initializing the new classifier. Finally, replace the worst classifier in the ensemble. 5. Adjust the label budget to the corresponding value based on the detected drift flag. Algorithm 2 presents the pseudocode for the learning process of the AdaAL-MID algorithm. In the initial learning phase of the data stream, the ensemble classifier is initialized by directly requesting the true labels of instances, with the initial phase consisting  
Figure 2: The framework of the AdaAL-MID. of _sizeW_ instances (a sliding window size). After initialization, the decision to request label for subsequent instances is determined by the mixed-label request strategy. First, a random value \(\delta\in[0,1]\) is generated through the random strategy. If this value is less than the random selection rate R, the random strategy is satisfied, and the true label \(y\) of the instance is requested. The current class distribution \(cd\) is updated based on its class (lines 5-8). If the random strategy does not satisfy the condition, the uncertainty selection strategy activates, and algorithm 1 determines whether to request a label (lines 9-10). If the label request strategy is satisfied and there is a surplus in the current label budget (i.e., \((l/p)<b\)), the true label of the instance is requested, the number of marked instances \(l\) is increased by one, and the training phase is entered (lines 11-13). First, according to the class to which the instance belongs, \(y\), the instance is stored in the corresponding class's sliding window \(\textit{Win}[y]\) (line 14). Next, the corresponding adaptive sampling strategies and weighted ensemble strategies are executed for each base classifier in the ensemble, considering the class proportions and classifier performance comprehensively to determine the instance sampling weight, \(SW_{j}\), and obtaining the online resampling count through a Poisson distribution \(k\sim poisson(SW_{j})\). Then, the weight, \(CW_{j}\), of the base classifier is obtained through a weighted ensemble strategy combining the recall rate and kappa coefficient, and the ensemble classifier is updated online based on this weight (lines 15-20). Finally, ADWIN is used to detect potential concept drifts in the data stream. If a drift flag is successfully triggered, a new classifier, \(C_{new}\), is retrained on the most recent instances in the sliding window, replacing the worst classifier in the ensemble. The label budget is dynamically adjusted according to the strategy proposed in Section 3.2 under this drift flag. This process is repeated until learning is complete (lines 21-25). ```
Input: data stream, \(S\); number of classifiers, \(N\); size of instance sliding window, sizeW; initial value of M\({}_{1}\), \(\theta_{1}\); initial value of M\({}_{2}\), \(\theta_{2}\); labeling budget, \(b\).