# Active Learning for Biomedical Article Classification with Bag of Words and _FastText_ Embeddings
## 2 Materials and Methods
### Active Learning
#### 2.3.3 Query Selection  
Ideally, at each active learning iteration, class labels should be requested for those instances which would contribute the most to model quality improvement. Several query selection heuristics are known in the literature that attempt to approximate this ideal criterion [44]. Some of them are only applicable to particular classification algorithms or model representations. For this work, using two substantially different classification algorithms, algorithm-independent strategies are of greater interest. These include the following:  
**Uncertainty sampling:**: selecting instances about which the current model is the most uncertain;
**Diversity sampling:**: selecting instances that differ from those already in the training set the most;
**Minority sampling:**: selecting instances with the highest minority class probability;
**Threshold sampling:**: selecting instances with the minority class probability closest to a specified threshold;
**Random:**: uniform random sampling used as a comparison baseline.  
Uncertainty sampling assumes that the training instances that are the hardest to classify by the current model are also the most likely to improve model quality. Class probability predictions are used to identify instances in the pool with the highest prediction uncertainty. Several uncertainty measures can be applied for this purpose [45], but for binary classification with models providing class probability predictions, as assumed bythis work, uncertainty sampling reduces to selecting instances for which the predicted probability of the more probable class is the closest to 0.5, i.e.,  
\[\text{minimize for }x\in P\text{:}\quad|p_{x}^{*}-0.5|, \tag{1}\]  
where \(p_{x}^{*}\) is the predicted probability of the more probable class for instance \(x\).  
Diversity sampling is motivated by the expectation that the most useful new training instances would be maximally different from those previously added to the training set. This strategy selects instances from the pool with the highest minimum dissimilarity to instances in the training set:  
\[\text{maximize for }x\in P\text{:}\quad\min_{x^{\prime}\in T}\delta(x,x^{ \prime}), \tag{2}\]  
where \(\delta(x,x^{\prime})\) denotes the dissimilarity between instances \(x\) and \(x^{\prime}\).  
Minority sampling is applicable when classes are expected to be heavily imbalanced and attempts to compensate for the imbalance by selecting instances that are likely to represent the minority class. These are identified as instances from the pool with maximum predicted minority class probabilities:  
\[\text{maximize for }x\in P\text{:}\quad p_{x}^{1}, \tag{3}\]  
where \(p_{x}^{1}\) is the predicted probability of the minority class for instance \(x\). This strategy is sometimes referred to as certainty-based sampling [16; 19; 23].  
Threshold sampling is another approach to compensating for class imbalance during query selection. It can be considered a modified version of uncertainty sampling, which takes into account that with heavily imbalanced classes, similar class probability values close to 0.5 may not actually correspond to the most uncertain predictions. A smaller probability threshold \(0<\theta<0.5\) is assumed instead, and instances for which the predicted minority class probability is the closest to this threshold are selected:  
\[\text{minimize for }x\in P\text{:}\quad|p_{x}^{1}-\theta|. \tag{4}\]