---
abstract: 'A common problem of the real-world data sets is the class imbalance, which can significantly affect the classification abilities of classifiers. Numerous methods have been proposed to cope with this problem; however, even state-of-the-art methods offer a limited improvement (if any) for data sets with critically under-represented minority classes. For such problematic cases, an “outside the box” solution is required. Therefore, we propose a novel technique, called enrichment, which uses the information (observations) from the external data set(s). We present three approaches to implement enrichment technique: (1) selecting observations randomly, (2) iteratively choosing observations that improve the classification result, (3) adding observations that help the classifier to determine the border between classes better. We then thoroughly analyze developed solutions on ten real-world data sets to experimentally validate their usefulness. On average, our best approach improves the classification quality by 27%, and in the best case, by outstanding 66%. We also compare our technique with the universally applicable state-of-the-art methods. We find that our technique surpasses the existing methods performing, on average, 21% better. The advantage is especially noticeable for the smallest data sets, for which existing methods failed, while our solutions achieved the best results. Additionally, our technique applies to both the multi-class and binary classification tasks. It can also be combined with other techniques dealing with the class imbalance problem.'
author:
- |
    Hubert Jegierski\
    Faculty of Computer Science and Management\
    Wrocław University of Science and Technology\
    Wrocław, Poland\
    `hubert.jegierski@gmail.com`\
    Stanisław Saganowski\
    Department of Computational Intelligence\
    Faculty of Computer Science and Management\
    Wrocław University of Science and Technology\
    Wrocław, Poland\
    `stanislaw.saganowski@pwr.edu.pl`\
bibliography:
- 'bibliography.bib'
title: 'An “outside the box” solution for imbalanced data classification'
---

Introduction {#sec:introduction}
============

The Class Imbalance Problem (CIP) occurs when the distribution of data between considered classes is imbalanced, i.e., one of the classes, called the dominant or majority class, exceeds the size of the other classes (minority classes). The CIP is especially undesired in prediction/classification tasks as most of the existing algorithms will focus on the classification of the dominant class while ignoring or misclassifying under-represented observations. Unfortunately, against our will, real-world data sets tend to express an imbalanced nature. In result, the CIP is a well-known problem to many everyday situations like medical diagnosis prediction [@krawczyk2016evolutionary; @yuan2018regularized; @fotouhi2019comprehensive], detecting frauds in banking operations [@soh2019predicting; @shi2015novel; @van2015apate], image processing [@khan2017cost; @feng2019imbalanced], natural language processing [@wang2019research; @al2017using; @krawczyk2017sentiment], real-time data streaming [@pouyanfar2018dynamic; @hoens2012learning], and other prediction/classification tasks [@cieslak2006combating; @burez2009handling; @pan2014graph; @yan2015deep; @kim2016ordinal].

A great number of methods dealing with the CIP have been proposed. However, sometimes, they cannot be applied (a very often problem for small data sets), or their effectiveness is unsatisfactory. Therefore, we propose a new data set balancing technique called enrichment. Its main idea is adding observations from an external data set to the under-represented class(es) of the considered data set. Using ten real-world data sets we thoroughly analyze three different enrichment scenarios: (1) random selection of observations from external data set(s); (2) semi-greedy - iterative selection of observations from the external data set(s) which improve the final classification; and (3) supervised, in which only observations that help the classifier to determine the border between classes are selected from the external data set(s). We show that our solution outperforms other methods, especially for small data sets, where existing solutions were unable to improve the classification accuracy. On the considered data sets, we achieved, on average, 21% better results than competitive techniques.

To emphasize, our contributions are: (1) a new technique, called data set enrichment, for dealing with the Class Imbalance Problem; (2) three approaches to implement data set enrichment; (3) the successful solution for balancing data sets with a critically low number of under-represented class (e.g. 4 observations); (4) the first-ever solution that improves the results of minority classes without affecting the result of the dominant class(es); (5) an experimental evaluation of the proposed solutions, including comparison with the state-of-the-art methods and the transfer learning technique.

Related work {#sec:related_work}
============

Existing methods aiming to reduce the negative effect of the CIP can be divided into three types: (1) data-level methods focused on lowering the quantitative difference between classes, e.g., by sampling the majority class, or by multiplying examples of the minority class; (2) algorithm-level methods that modify or extend classifiers to deal with imbalanced classes, e.g., a classifier with the cost matrix - a misclassification of the minority class is much more expensive than a misclassification of the majority class; (3) hybrid methods combining the abilities of the two previous types.

The most often data-level concepts are sampling methods (the most popular), data cleaning techniques, and feature selection methods. The sampling technique can be performed as under-sampling, over-sampling, and mixed sampling. The under-sampling removes examples from the dominant class. It is effortless to perform but loses information when selecting a subset of the majority class. On the other hand, the reduced data set speeds up the learning process and reduces the required memory space. The simplest version of under-sampling is Random Under-sampling (RUS), explained in [@japkowicz2002class], which randomly eliminates examples from the dominant classes. More advanced approaches include clusterization [@sun2015novel; @yen2009cluster], evolutionary algorithms [@jain2017addressing; @krawczyk2016evolutionary], instance hardness identification [@smith2014instance], and weighting objects based on Euclidean distance [@kang2017distance].

The over-sampling, on the contrary, increases the size of the minority set by duplicating existing observations or generating artificial ones. This approach is not losing information, but it requires a greater amount of computing power, and an inappropriate increase in the data set might lead to overfitting of the model. Again, the most simple approach, Random Over-sampling (ROS), explained in [@japkowicz2002class], is based on multiplying randomly selected observations of the minority class. Another method, widely used, is Synthetic Minority Over-sampling Technique [@chawla2002smote] (SMOTE), which generates synthetic observations based on the selected observation and its neighbors. Many extensions and modifications to the SMOTE algorithm have been proposed, e.g., the Borderline SMOTE [@han2005borderline] (bSMOTE), which detects and uses the borderline observations to generate new synthetic samples. Other over-sampling concepts employ clusterization [@cieslak2006combating], genetic algorithms [@li2017adaptive], potential functions [@krawczyk2019radial], and identification of harder to learn observations [@he2008adasyn].

Mixed sampling is a combination of under-sampling and over-sampling. It combines benefits (and some limitations) of both approaches mentioned above. Some methods applying the mixed sampling technique are Selective Preprocessing of Imbalanced Data [@wojciechowski2017algorithm] (SPIDER), Optimal Genetic Algorithms based Resampling [@vannucci2017genetic] (OGAR), SMOTE-ENN [@batista2004study] combining SMOTE and Edited Nearest Neighbors [@wilson1972asymptotic], and SMOTE-TL [@batista2003balancing] combining SMOTE and Tomek Links [@tomek1976two].

The most significant advantage of sampling techniques is the possibility to apply them at the pre-processing stage, regardless of the further steps, i.e., classifiers used. This advantage allows for combining sampling techniques with algorithm-level methods for reducing the imbalanced data set effect. The most often applied algorithm-level technique is the cost-sensitive learning [@elkan2001foundations; @domingos1999metacost]. The approach emphasizes the correct classification of the minority objects by assigning a high penalty for the misclassification of these objects. The penalty is stored in the form of a cost matrix. The advantage of cost-sensitive learning is its computational efficiency [@haixiang2017learning]. However, determining the values of the cost matrix is not trivial and might require many attempts. Additionally, this approach demands modification of the learning algorithm. Another popular technique is a classifier ensemble. Several classifiers perform classification of the same observations independently, and their output is later combined into an ensemble output. Usually, the most commonly assigned label is selected as the final output. The benefits of this approach include the ability to bypass the statistical problem, i.e., the learning set is too small, and the ability to reduce the bias of a single classifier. The shortcomings of the approach are the lack of clear guidelines for choosing the ensemble members and the lack of voting methods tailored to imbalanced data [@krawczyk2016challenges]. In [@sun2015novel], each of the ensemble’s classifiers is trained on a different, balanced training set, and in [@ksieniewicz2017dealing], the visual representation of the numerical data distribution called *exposer* is used.

There are also many algorithm-level strategies that extend existing learning algorithms, e.g., strengthen the discriminatory feature of classifiers [@raj2016towards], use gravitational forces to determine the neighborhood in k nearest neighbor classifier [@nikpour2017proposing], extend a classifier by fuzzy methods [@patel2017classification]. Yet another interesting approach is presented in [@krawczyk2014weighted], where authors used one-class learning. By focusing on a single class, the method develops an accurate description of the target class, and thus classify it very well, rejecting outliers.

In contrast to the imbalanced binary classification, the multi-class classification from imbalanced data is not as well developed. A common approach is the decomposition of a complex problem to a set of binary tasks. The two most widely used techniques include one-vs-one (OVO), and one-vs-all (OVA) approaches. The OVO strategy divides the problem into subtasks, where each of them is aimed at distinguishing a given pair of classes. In turn, the OVA approach trains every classifier so that it recognizes a given class. However, such solutions have their drawbacks: OVA loses information on the relationship between classes, while OVO leads to excessive complexity related to the analysis of all possible combinations.

The last group of methods dealing with imbalanced data combines data-level and algorithm-level concepts. An example is an ensemble of classifiers enhanced with a sampling technique [@nanni2015coupling].

Although, there are many examples showing the usefulness of methods dealing with the CIP [@krawczyk2016evolutionary; @yuan2018regularized; @fotouhi2019comprehensive; @soh2019predicting; @shi2015novel; @van2015apate; @khan2017cost; @feng2019imbalanced; @wang2019research; @al2017using; @krawczyk2017sentiment; @pouyanfar2018dynamic; @hoens2012learning; @cieslak2006combating; @burez2009handling; @pan2014graph; @yan2015deep; @kim2016ordinal], there are cases when existing methods cannot be applied, or their performance is low. This limitation is especially noticeable for data sets with a low number of observations and data sets with a significant imbalance ratio. When there are only a few observations of a minority class, the richness of information is to low to produce diverse synthetic observations using the over-sampling technique. At the same time, under-sampling the majority class to only a few observations will result in a set too small to successfully train the classifier.

Therefore, in this paper, we propose a new technique called data set enrichment, which consists of adding observations of the minority class(es) from the external data set(s). We propose three enrichment scenarios: random, semi-greedy, and supervised. We show that our solution often outperforms other existing methods, especially for small data sets, where existing solutions were unable to improve the classification accuracy. On the considered data sets, we achieved, on average, 21% better results than when using competitive techniques.

Materials and Methods {#sec:materials_&_methods}
=====================

Before explaining our methods, we first need to introduce the Imbalance Ratio formula and explain various types of imbalanced objects.

Imbalance ratio
---------------

The ratio between the dominant class and other classes can be expressed with the Imbalance Ratio ($IR$) value; see \[eq:1\]. The minority classes can be then defined as classes with $IR$ below a certain threshold, e.g., 0.2.

$$IR = \frac{|M_b|}{|D_b|},
\label{eq:1}$$

where $D_b$ is a subset of data set $b$ that is labeled with the dominant class and $M_b$ is a subset of data set $b$ that is labeled with the considered, non-dominant class.

Object types
------------

Napierała and Stefanowski, in [@napierala2016types], focused on the neighborhood of minority class objects. They identified four scenarios for which they introduced four types of minority objects:

-   Safe objects (Fig. \[fig\_observation\_types\]A) – which are neighboring only with objects of the same class, and are distanced from the potential class decision boundary. These examples are simple to learn by classifiers.

-   Borderline objects (Fig. \[fig\_observation\_types\]B) – objects located near the potential class decision boundary, important for determining the location of the separating plane of the class. These examples are very often misclassified as the dominant class.

-   Rare objects (Fig. \[fig\_observation\_types\]C) – objects clustered in small groups of several items, located inside the dominant class, away from the center of the associated minority class. These are examples that should be given special attention, as they tend to be ignored (considered as a noise) by a classifier, and they often constitute a large part of all minority observations [@stefanowski2013overlapping].

-   Outlier objects (Fig. \[fig\_observation\_types\]D) – individual minority objects located inside the dominant class. Outliers should not be considered as noise, because they can create subgroups of valid objects, and inform about the potential area of the appearance of new minority objects.

We use their notation in our method.

![Four types of minority class objects: (**A**) safe objects, (**B**) borderline objects, (**C**) rare objects, (**D**) outlier objects.[]{data-label="fig_observation_types"}](Figures/observation_types.png){width="\textwidth"}

Random Enrichment
-----------------

The first of the proposed methods of enrichment is Random Enrichment (RanE), which consists of adding random learning patterns from the external data set(s) to the considered base set. Algorithm \[alg1\_ranE\] provides the pseudo-code of this approach. At first, the minority classes $M_b$ of the base set $b$ are determined using $IR$ formula \[eq:1\]. Next, the corresponding classes $M_e$ in the external data set(s) $e$ are identified. Finally, a specified percentage amount $A\%$ of observations from classes $M_e$ are added to the base set $b$, resulting in the enriched data set $b^\prime$.

base set $b$, external set $e$, imbalance ratio $IR$ among classes in $b$, amount of enrichment $A\%$ enriched set $b^\prime$ determine minority classes $M_b$ in set $b$ based on $IR$ identify corresponding classes $M_e$ in set $e$ sample $A\%$ of set $M_e$ and add it to base set $b\prime$

Semi-greedy Enrichment
----------------------

The second proposed approach is called Semi-greedy Enrichment (SemE), as it iteratively validates, which observations from the external data set(s) will increase the classification performance. See Fig. \[fig\_seme\_supe\]B for an example and Algorithm \[alg2\_semE\] for the pseudo-code. The minority classes $M_b$ of the base set $b$, and the corresponding classes $M_e$ in the external data set(s) $e$ are recognized. The base set $b$ is divided into learning part $b_l$ and evaluation part $b_{ev}$ with ratio 9:1 using stratified sampling. Using the preferred classifier $C$ (in our case Random Forest), the baseline classification performance $C_{best}$ is established. Then, iteratively, one observation $O$ at a time from class(es) $M_e$ is added to the base learning set $b_l$ and the new classification performance $C_{new}$ is computed using $b_{ev}$. If performance has improved, observation $O$ is kept in set $b_l$, and the baseline classification performance is updated; otherwise, observation is discarded. The iterative process is repeated until all observations from $M_e$ are evaluated. The final output will be enriched set $b^\prime$, in which the classification performance will be at least as good as the classification performance of the base set $b$.

base set $b$, external set $e$, imbalance ratio $IR$ among classes in $b$, classifier $C$ enriched set $b^\prime$ determine minority classes $M_b$ in set $b$ based on $IR$ identify corresponding classes $M_e$ in set $e$ divide set $b$ into learning part $b_l$ and evaluation part $b_{ev}$ with ratio 9:1 using stratified sampling calculate baseline classification performance $C_{best}$ using classifier $C$ add $O$ to $b_l$ and evaluate classification performance $C_new$ keep $O$ in $b_l$ $C_{best} = C_{new}$ remove $O$ from $b_l$ $b\prime$

\[fig\_seme\_supe\] ![An example of how the base set (**A**) can be enriched with external observations using the SemE (**B**) and the SupE (**C**) methods. The external observations added with SemE and SupE are marked yellow and red, respectively.](Figures/seme_supe.png "fig:"){width="\textwidth"}

Supervised Enrichment
---------------------

The last developed method, called Supervised Enrichment (SupE), assumes that only external observations of a particular type are added. In our study, we have only used the borderline observations, as these help classifiers in defining boundaries between classes, see Fig. \[fig\_seme\_supe\]C for an example. The pseudo-code of the algorithm is presented in Algorithm \[alg3\_supE\]. At first, the minority classes $M_b$, and the corresponding classes $M_e$ are determined. Then, the SemE algorithm can be applied to increase the number of observations in classes $M_b$. This extra step will help in finding more borderline observations from the external data set. An alternative approach to SemE at this point could be an over-sampling technique within rare observations. Observations added during SemE step (if any) are removed from the external set $e$ to assure they will not be added again in further steps. Next, observations in $M_e$ are labeled with a type they will have when added to set $b$. The type is determined according to the method by Napierała and Stefanowski [@napierala2016types] (see the next section) with $k$ parameter equal to five. Finally, the borderline objects are added to set $b$ until $IR$ among classes $M_b$ and class $D_b$ equals one or until all available borderline observations are added. The final set is enriched set $b^\prime$.

The decision whether to use an additional step (SemE or an over-sampling technique) depends on the number of external observations that one will be able to obtain without this extra step. If the minority class is too small, it might be difficult (or even impossible) to find observations of the desired type.

base set $b$, external set $e$, imbalance ratio $IR$ among classes in $b$, classifier $C$ enriched set $b^\prime$ perform SemE algorithm remove from $e$ observations added to $b$ with SemE obtain borderline observations from $M_e$ add obtained observations to $b$ until $IR = 1$ or all observations are added $b\prime$

Experiments
===========

One of our goals was to enrich the base set with as many different external data sets as possible. This would allow evaluating if (1) the considered base set prefers a particular external data set, and (2) a particular external data set can be more useful than others to several base sets. To achieve this goal, we required several different data sets with the same multiple classes labeled, and with the same feature space. Hence, we have used eight real-world complex network data from our previous extensive work on group evolution prediction [@saganowski2019gep] that are publicly available [@saganowski2018data]. In addition, we have used Breast Tumor (BRE) [@dataset_BRE] and Prostate Tumor (PRO) [@dataset_PRO] data to validate the solution for the binary classification task and also outside the context of the complex networks. Each data set has a different size and the class imbalance ratio, see Appendix \[appendix:results\_by\_class\]. For the classification task on the complex network data sets, six classes are determined by 88 features. For the BRE and PRO data sets, two classes are described by 30 and 8 features, respectively. The F-measure averaged over all classes is used as the quality performance measure. The detailed information on data used, pre-processing, and on the experimental setup is provided in Appendix \[appendix:experiment\_setup\].

Random Enrichment
-----------------

The effectiveness of Random Enrichment (RanE) is presented in Table \[tab\_ranE\]. It can be observed that it is possible to find a random subset of an external data set that improves the classification quality of the considered base set $b$ (in this case, the MIT data set). Let us emphasize that for each external data set, such a subset has been found (cells marked with green color in Table \[tab\_ranE\]). It can also happen that randomly sampled observations from the external data set(s) added to the base set results in lower classification quality (cells marked red). For some external data sets (in this case, Digg, IrvineMessages, Slashdot, Infectious), all randomly selected subsets improved the classification quality, and for other (Loans, Facebook, Twitter) only a few subsets boosted the classification. The best scenario, adding 90% of the Infectious $M_e$ classes, improved the classification of the MIT data set by +20% (cell marked with yellow color in Table \[tab\_ranE\]). The Infectious was the best external data set to enrich the MIT data set, on average, boosting the classification by 12%.

The other 7 data sets related to complex networks have also been successfully randomly enriched. The full results are provided in Appendix \[appendix:rane\_full\_results\].

Despite many analyses, we can not provide any formal rules on how to select the enrichment set to obtain a better classification on the base set with the RanE method. No correlation was found with either the number of observations added nor the characteristics of the external or base data sets (size, network degree, network betweenness, and other network measures). Most probably, the quality (the type as defined by Napierała and Stefanowski) of observations being added is the crucial factor behind the successful random enrichment. In that sense, the procedure of the algorithm, i.e., the random selection of a subset, determines the outcome. Hence, the name of the method - Random Enrichment.

[c|cLccccc]{} &\
(lr)[2-8]{} & **Digg** & **Irvine Messages** & **Loans** & **Facebook** & **Slashdot** & **Infectious** & **Twitter**\
0% &\
10% & 0.219 +4% & 0.222 +6% & 0.209 -0% & 0.208 -1% & 0.218 +4% & 0.233 +11% & 0.192 -9%\
20% & **0.233 +11%** & 0.222 +6% & 0.217 +3% & 0.213 +1% & 0.213 +1% & 0.215 +2% & 0.197 -6%\
30% & 0.228 +9% & **0.223 +6%** & 0.220 +5% & **0.219 +4%** & 0.221 +5% & 0.220 +5% & 0.216 +3%\
40% & 0.227 +8% & 0.220 +5% & 0.195 -7% & 0.203 -3% & 0.220 +5% & 0.242 +15% & **0.230 +10%**\
50% & 0.230 10% & 0.220 +5% & 0.206 -2% & 0.199 -5% & **0.224 +7%** & 0.233 +11% & 0.197 -6%\
60% & 0.223 +6% & 0.218 +4% & **0.221 +5%** & 0.209 -0% & 0.221 +5% & 0.225 +7% & 0.211 +0%\
70% & 0.223 +6% & 0.215 +2% & 0.213 +1% & 0.208 -1% & 0.211 +0% & 0.249 +19% & 0.225 +7%\
80% & 0.227 +8% & 0.213 +1% & 0.214 +2% & 0.208 -1% & 0.221 +5% & 0.243 +16% & 0.209 -0%\
90% & 0.217 +3% & 0.218 +4% & 0.208 -1% & 0.207 -1% & 0.221 +5% & **0.252 +20%** & 0.200 -5%\
100% & 0.230 +10% & 0.222 +6% & 0.209 -0% & 0.214 +2% & 0.215 +2% & 0.235 +12% & 0.194 -8%\

Semi-greedy Enrichment
----------------------

The Semi-greedy Enrichment (SemE) is proposed to overcome the randomness of the RanE method and to guarantee an improvement in the classification. The results of SemE are very promising, and by far exceeded our expectations, see Table \[tab\_semE\] for results obtained with the Random Forest classifier. On average, the classification of the base set was improved by 18% (bolded cells in Table \[tab\_semE\]), and in the best cases by impressive 40% (MIT and Infectious enriched with Twitter observations, yellow cells in Table \[tab\_semE\]). With the Decision Tree classifier, the improvement was even greater and reached 43% (see Table \[tab\_seme\_decision\_tree\]). The observations from the Twitter data set turned out to be the best enriching subsets among all considered data sets, enhancing the classification of base sets, on average, by 19%. The reason might be the highest number of observations in the Twitter data set belonging to the minority classes, which gives the SemE algorithm a broader set to pick from. The most susceptible to enrichment base sets were Infectious (on average +28%) and MIT (on average +21%). Again, these two data sets are the least numerous, and that can be the reason why they benefited from the new observations more than other data sets.

[L|cLccccccc]{} &\
(lr)[2-9]{} & **Digg** & **Irvine Messages** & **Loans** & **Facebook** & **MIT** & **Slashdot** & **Infectious** & **Twitter**\
- & 0.226 & 0.212 & 0.180 & 0.260 & 0.206 & 0.249 & 0.250 & 0.191\
**Digg** & & 0.215 +1% & 0.198 +10% & 0.267 +3% & 0.230 +12% & 0.265 +6% & 0.334 +34% & 0.201 +5%\
**Irvine Messages** & 0.236 +4% & & 0.208 +16% & 0.263 +1% & 0.228 +11% & 0.264 +6% & 0.313 +25% & 0.198 +4%\
**Loans** & 0.231 +2% & 0.218 +3% & & 0.261 +0% & 0.238 +16% & 0.265 +6% & 0.323 +29% & 0.197 +3%\
**Facebook** & 0.228 +1% & 0.217 +2% & 0.198 +10% & & 0.245 +19% & **0.266 +7%** & 0.320 +28% & **0.204 +7%**\
**MIT** & 0.230 +2% & 0.224 +6% & 0.196 +9% & 0.261 +0% & & 0.264 +6% & 0.267 +7% & 0.198 +4%\
**Slashdot** & 0.239 +6% & **0.248 +17%** & **0.214 +19%** & 0.271 +4% & 0.266 +29% & & 0.337 +35% & 0.194 +2%\
**Infectious** & 0.233 +3% & 0.232 +9% & 0.193 +7% & 0.266 +2% & 0.251 +22% & 0.261 +5% & & 0.194 +2%\
**Twitter** & **0.240 +6%** & 0.242 +14% & 0.191 +6% & **0.277 +7%** & **0.288 +40%** & 0.265 +6% & **0.349 +40%** &\

Supervised Enrichment
---------------------

The Supervised Enrichment (SupE) is more computationally demanding than previous techniques. It may need to run SemE first and then requires assigning the type to all observations from base and external data sets. Table \[tab\_supE\] contains the results of SupE application to eight data sets related to complex networks. The external data set for each base set was determined during the SemE procedure (see Table \[tab\_semE\], e.g., the Twitter data set was used for Digg, Facebook, MIT, and Infectious data sets. It can be easily noticed that the additional computational complexity of the SupE method is generously rewarded. The SupE approach raised the classification performance, on average, by 27%. In the best case, a perfectly balanced Infectious data set, the result was improved by outstanding 66%. Once more, the smallest data sets, Infectious and MIT, gained most: +66% and +46%, respectively.

More detailed results, which include F-measure for each class (see Appendix \[appendix:results\_by\_class\]), reveal that the SupE approach almost always improves the results of all classes, minority as well as dominant. There were only a few exceptions where SupE decreased the initial F-measure value of a particular class. It means SupE improves the classification of the minority classes without a negative effect on the other classes, especially the dominant class. This is a highly desired, yet tough to achieve, advantage that has not been demonstrated by any other existing method.

We have also analyzed the influence of the number of external observations added to the base set on the improvement of the classification performance. The amount varies from 0% (no additional observations, baseline) to 100% of the difference between $|D_b|$ and $|M_b|$ (to obtain $IR = 1$). One can observe (compare rows in Table \[tab\_supE\]) how the classifier progressively saturates with additional information (borderline observations) and boosts the classification quality up to a certain point. Once at this point, the additional information does not enhance the classifier’s ability to differentiate between classes. As a result, further gain in classification performance is not achieved (at least with the considered technique). Interestingly, this point is often met at the very beginning (10% of $|M_e|-|M_b|$). This phenomenon will be yet investigated. The process of obtaining the external borderline observations is costly; therefore, if one has limited resources, adding only 10% of additional observations might be an option. In our case, it improved the results of all data sets, on average, by 22%.

[L|cLcccccc]{} &\
(lr)[2-9]{} & **Digg** & **Irvine Messages** & **Loans** & **Facebook** & **MIT** & **Slashdot** & **Infectious** & **Twitter**\
0% & 0.226 & 0.212 & 0.180 & 0.260 & 0.206 & 0.249 & 0.250 & 0.191\
10% & 0.265 +17% & 0.250 +18% & 0.218 +21% & **0.294 +13%** & 0.278 +35% & **0.278 +12%** & 0.370 +48% & **0.213 +12%**\
20% & 0.266 +18% & 0.251 +18% & 0.219 +22% & **0.294 +13%** & 0.286 +39% & **0.278 +12%** & 0.367 +47% & **0.213 +12%**\
30% & 0.267 +18% & 0.250 +18% & 0.221 +23% & **0.294 +13%** & 0.284 +38% & **0.278 +12%** & 0.373 +49% & **0.213 +12%**\
40% & 0.267 +18% & 0.252 +19% & 0.219 +22% & **0.294 +13%** & 0.284 +38% & **0.278 +12%** & 0.370 +48% & **0.213 +12%**\
50% & **0.268 +19%** & 0.252 +19% & 0.223 +24% & **0.294 +13%** & 0.288 +40% & **0.278 +12%** & 0.382 +53% & **0.213 +12%**\
60% & **0.268 +19%** & 0.254 +20% & 0.223 +24% & **0.294 +13%** & 0.289 +40% & **0.278 +12%** & 0.375 +50% & **0.213 +12%**\
70% & **0.268 +19%** & 0.256 +21% & 0.224 +25% & **0.294 +13%** & 0.291 +41% & **0.278 +12%** & 0.387 +55% & **0.213 +12%**\
80% & **0.268 +19%** & 0.258 +22% & 0.225 +25% & **0.294 +13%** & 0.293 +42% & **0.278 +12%** & 0.396 +58% & **0.213 +12%**\
90% & **0.268 +19%** & 0.257 +21% & 0.228 +27% & **0.294 +13%** & **0.301 +46%** & **0.278 +12%** & 0.405 +62% & **0.213 +12%**\
100% $IR=1$ & **0.268 +19%** & **0.259 +22%** & **0.230 +28%** & **0.294 +13%** & 0.300 +46% & **0.278 +12%** & **0.415 +66%** & **0.213 +12%**\

Comparison results
------------------

The proposed approaches were compared with nine state-of-the-art methods for learning from imbalanced data sets: Random Under-sampling, Random Over-sampling, SMOTE [@chawla2002smote], bSMOTE [@han2005borderline], SMOTE-ENN [@batista2004study], SMOTE-TL [@batista2003balancing], IHT [@smith2014instance], ADASYN [@he2008adasyn], MC-RBO [@krawczyk2019radial]. Some are designed to cope with the multi-class classification, and for others, we have used decomposition techniques (OVO and OVA). The detailed setup attributes and hyperparameters adjustments, as well as validation procedure, are provided in Appendix \[appendix:validation\].

Our solutions, namely RanE, SemE, SupE, outperformed the state-of-the-art methods for the multi-class classification task, see Table \[tab\_comparison1\]. The superiority of the developed algorithms is especially notable for the smallest data sets: Infectious and MIT. For these two sets, all methods from the literature, except bSMOTE, were unable to enhance the classification quality (or achieved negligible improvement), while our solutions provided the best enhancement among all considered data sets.

The RUS was the only method that was unable to improve results for all considered data sets. On average, RUS worsened the results by 23%. Also, IHT did not perform well, improving only the result for the Twitter data set and worsening the results, on average, by 14%. The SMOTE-ENN and the SMOTE-TL had difficulty mainly with the smallest data sets, achieving decent results for other data sets. The ADASYN failed to run on data sets with critically low under-represented class; hence, the results are not provided. For other data sets, except Twitter, where it worsened result by 20%, the ADASYN performed well. The MC-RBO has been applied only to small data sets, as the computations for more massive sets took too long. The MC-RBO’s results are indistinctive. The ROS and the SMOTE methods failed only for the smallest data set and the Twitter data set. They gained, on average, 1% and 2%, respectively. The best among the compared methods was bSMOTE, which enhanced the results, on average, by 10%. In the best case, bSMOTE boosted the result by 19% (the MIT data set). It was the only state-of-the-art method that managed to improve results for all complex network data sets.

Our algorithms, in comparison with the existing solutions, performed significantly better. Even the most simple of them, the RanE method, managed to improve results for all considered data set, even though its principles does not guarantee the improvement. On average, RanE improved the classification quality by 7%, and in the best case by 17% (the Infectious data set). The SemE method was even better, achieving, on average, 19% improvement for all data sets, which is 7% more than bSMOTE and 10% more than RanE. Additionally, SemE guarantees that the obtained result will not be lower than the baseline. The SupE approach was by far the best algorithm, increasing the classification capabilities for the considered data sets, on average, by 27%. This is 16% more than bSMOTE, 19% more than RanE, and 8% more than SemE.

[c|MMMMMMMM|&gt;m[0.05]{}]{} & &\
(lr)[2-9]{} & **Digg** & **Irvine Messages** & **Loans** & **Facebook** & **MIT** & **Slashdot** & **Infectious** & **Twitter**\
None & 0.226 & 0.212 & 0.180 & 0.260 & 0.206 & 0.249 & 0.250 & 0.191 & -\
**RUS** & 0.202 -11% & 0.186 -12% & 0.098 -46% & 0.186 -28% & 0.132 -36% & 0.207 -17% & 0.184 -26% & 0.174 -9% & -23%\
**ROS** & 0.227 +0% & 0.224 +6% & 0.199 +11% & 0.261 +0% & 0.209 +1% & 0.268 +8% & 0.236 -6% & 0.162 -15% & +1%\
**SMOTE** & 0.231 +2% & 0.234 +10% & 0.201 +12% & 0.265 +2% & 0.226 +10% & 0.271 +9% & 0.213 -15% & 0.158 -17% & +2%\
**bSMOTE** & 0.244 +8% & 0.229 +8% & 0.193 +7% & 0.288 +11% & 0.246 +19% & **0.278 +12%** & 0.270 +8% & 0.204 +7% & +10%\
**SMOTE-ENN** & 0.224 -1% & 0.222 +5% & 0.189 +5% & 0.262 +1% & 0.167 -19% & 0.272 +9% & 0.176 -30% & 0.193 +1% & -4%\
**SMOTE-TL** & 0.238 +5% & 0.227 +7% & 0.198 +10% & 0.286 +10% & 0.201 -2% & 0.274 +10% & 0.247 -1% & 0.192 +1% & +5%\
**IHT** & 0.142 -37% & 0.177 -17% & 0.155 -14% & 0.231 -11% & 0.206 +0% & 0.191 -23% & 0.219 -12% & 0.203 +6% & -14%\
**ADASYN** & 0.245 +8% & 0.229 +8% & 0.196 +9% & - & - & 0.276 +11% & - & 0.152 -20% & -\
**MC-RBO** & - & 0.223 +5% & - & - & 0.206 +0% & - & 0.261 +5% & - & -\
**RanE** & 0.232 +3% & 0.228 +8% & 0.189 +5% & 0.271 +4% & 0.233 +13% & 0.255 +2% & 0.293 +17% & 0.195 +2% & +7%\
**SemE** & 0.240 +6% & 0.248 +17% & 0.214 +19% & 0.277 +7% & 0.288 +40% & 0.266 +7% & 0.349 +40% & 0.204 +7% & +18%\
**SupE** & **0.268 +19%** & **0.259 +22%** & **0.230 +28%** & **0.294 +13%** & **0.301 +46%** & **0.278 +12%** & **0.415 +66%** & **0.213 +12%** & **+27%**\

To apply our solutions to the tumor data, we had to select only eight features from the BRE data set that were present in the PRO data set. However, to maintain the completeness of the research, we include the results on the unmodified BRE data set as well, see Table \[tab\_cancer\]. The classification quality for the BRE data set was the highest when using all 30 features and no balancing algorithm (0.960). Applying any state-of-the-art method on unmodified BRE data set only worsened this result. With only eight features available, the classification quality dropped to 0.911 (-5%). However, this time, applying our methods (and some methods from the literature) improved the classification performance. In this case, the SupE method turned out to be the best (0.951, +4%), although the result was still slightly worse than classification on the unmodified BRE data set. Apparently, the features that we have removed contained more learning information than the external observations obtained from the PRO data set. It would be very interesting to apply dimensionality reduction so that all available information could be preserved, but we leave this for future work.

For the PRO data set, all our solutions improved the classification quality. The RanE and SemE methods gained 3%, while the SupE method gained 6%. At the same time, only three methods from the literature (SMOTE, bSMOTE, MC-RBO) managed to improve the classification result, and the gain was negligible (less than 1%).

Overall, our methods surpassed the state-of-the-art methods again, and the SupE method was the best one. Let us note, that this time, the SupE method performed better without applying the SemE step first. Such a situation may happen when the base set already has enough number of minority observations to proceed with SupE. In that case, adding external observations with SemE is unnecessary, as it could move the class decision boundary in the wrong direction.

The obtained results are statistically significant. See Appendix \[appendix:statistical\_analysis\] for more details, and especially Table \[tab\_friedman\] for ranks of all compared methods.

  ------------------------- ----------------------- ---------------------- ----------------------
                                                                           
         (lr)[2-4]{}         **BRE (30 features)**   **BRE (8 features)**   **PRO (8 features)**
          **None**                   0.960                  0.911                  0.842
           **RUS**                 0.940 -2%              0.903 -1%              0.833 -1%
           **ROS**                 0.951 -1%              0.923 +1%              0.834 -1%
          **SMOTE**                0.947 -1%              0.919 +1%              0.849 +1%
         **bSMOTE**                0.948 -1%              0.920 +1%              0.844 +0%
        **SMOTE-ENN**              0.949 -1%              0.923 +1%              0.830 -1%
        **SMOTE-TL**               0.948 -1%              0.925 +2%              0.837 -1%
           **IHT**                 0.883 -8%              0.866 -5%              0.845 +0%
         **ADASYN**                0.944 -2%              0.910 -0%              0.828 -2%
         **MC-RBO**                0.930 -3%              0.929 +2%              0.847 +1%
          **RanE**                     -                  0.923 +1%              0.868 +3%
          **SemE**                     -                  0.936 +3%              0.866 +3%
    **SupE (with SemE)**               -                  0.865 -5%              0.868 +3%
   **SupE (without SemE)**             -                **0.951 +4%**          **0.894 +6%**
  ------------------------- ----------------------- ---------------------- ----------------------

  : The comparison of RanE, SemE, and SupE with the state-of-the-art methods for the binary classification on two data sets. To apply RanE, SemE, and SupE, the feature space of the Breast Tumor data set had to be adjusted. The classification executed with the Random Forest classifier and the F-measure averaged over two classes as the quality measure. Cells marked green indicate an improved classification quality, while cells marked red depict worse results. The best result for each data set is bolded and marked yellow.[]{data-label="tab_cancer"}

Discussion
==========

The results indicate that the proposed methods are very successful. There are, however, some points to discuss. First and foremost, the proposed solutions require at least one external data set with the same classes labeled and the same feature space as the base data set. Nevertheless, in the era of vast amounts of data, a necessity of an additional data set is not a significant problem. As of the same feature space requirement, one may perform a dimensionality reduction technique.

On the other hand, the existing methods have some drawbacks too. For example, the under-sampling methods require a certain amount of observations so that the dominant ones can be selected. During this process, some information (observations) is lost. The over-sampling methods, in turn, need a decent number of minority observations in order to produce diverse synthetic observations. Additionally, the observations created in this process are not real but synthetic. Our solution uses the external, but real, observations that could potentially exist in the considered data set.

A fascinating point to address is the idea of enriching the learning set with observations from an external data set, without any context or parametric requirements (besides the same class and feature spaces). With such a flexible principle, one may argue we assume that the characteristic of the observations in base and external data sets are the same. We do not; it is against many conducted research and intuition. We believe that, for instance, groups having the same characteristic may experience different events across various data sets. For example, large groups in co-authorship data set are much more likely to continue existence for many years, rather than to vanish rapidly. At the same time, large discussion groups on social platforms can last just a few hours and dissolve instantly. Nevertheless, our algorithms perform very well, carefree that the additional observations come from a different data set. We have two possible explanations for that. Either networks (or tumors) are not that much different after all, and have a similar pace of evolution (once normalized by the appropriate time window size selection). Alternatively, the processes responsible for the evolution of groups are much more complicated than we thought and not always linked to the data set context. Either way, this phenomenon will be further investigated to understand better which characteristics of the external data set are the critical factors for the successful enrichment of the base data set.

Moreover, the enriching technique, to some extent, can be compared to the transfer learning technique. Although, in our opinion, the influence of the external data context is marginal, as the number of external observations in the learning process is much lower than the number of base observations. The initial experiments revealed that the transfer learning technique performed better than RanE, but worse than the SemE and SupE approaches, on the considered data sets; see Appendix \[appendix:transfer\_learning\].

Furthermore, the proposed methods can be combined with any other technique for imbalanced data classification. For example, experiments combining SemE and SupE with bSMOTE showed that, in the case of SemE, the final result could be sometimes improved; see Appendix \[appendix:combining\_bsmote\].

Lastly, when performing SemE, the order in which the external observations are iterated might influence the final set of selected observations, hence the final classification result. The exact influence of the order will be analyzed in future experiments.

Conclusions and future work
===========================

To overcome the class imbalance problem, we have proposed to enrich the learning set with observations from the external data set. This task can be accomplished with three different approaches: (1) randomly selecting observations (RanE); (2) iteratively choosing observations that improve the classification result (SemE); (3) adding observations that help the classifier to determine the border between classes better (SupE). The developed solutions have been thoroughly validated on eight real-world data sets, and additionally, compared with the state-of-the-art methods.

The conducted experiments revealed that our technique outperformed the state-of-the-art methods, especially for the smallest data sets. The SemE and SupE solutions performed, on average, respectively 7%, and 16% better than bSMOTE (which was the best among the methods from the literature). For the two smallest data sets, our approaches were 2% (RanE), 23% (SemE), and 39% (SupE) better than bSMOTE. Apart from the better performance, our technique is free from the drawbacks of the existing methods: (1) no under-sampling means no loss of information, and (2) the lack of synthetic observations avoids bias that can occur when using generated observations. Furthermore, the proposed approaches can be used together with other data balancing methods, as well as any classification algorithm aimed at the class imbalance problem.

Among the presented approaches, SupE is by far the best one, achieving, on average, 27% improvement in classification quality. In the best case, the SupE method was able to enhance the final result by outstanding 66%. Even more remarkable is a unique ability of SupE to improve the classification performance on the minority classes without decreasing the performance of the dominant classes. We believe this is thanks to the well-thought-out process of external observations selection, in which only the particular type of information is acquired, i.e., the borderline observations, which help classifier to differentiate classes.

Let us also emphasize that the developed enrichment technique can be successfully applied to the multi-class classification task, for which the number of existing methods dealing with CIP is limited.

To further contribute to the field, we will continue to analyze which data sets’ characteristics should be similar to achieve the highest possible gain in classification quality. We will also perform the dimensionality reduction experiments (such as feature embedding or principal component analysis), to prove that different feature space is not a limitation when choosing the external set. Finally, we will determine the influence of the order in which the external observations are added in the SemE approach on the final result.

Funding {#funding .unnumbered}
-------

This work was partially supported by the National Science Centre, Poland, project no. 2016/21/B/ST6/01463; and the statutory funds of the Department of Computational Intelligence, Wroclaw University of Science and Technology.

Acknowledgments {#acknowledgments .unnumbered}
---------------

Authors thank Michał Koziarski for his consultations during the experiments and manuscript creation, as well as for sharing the code of the MC-RBO method. Authors also thank the Data Science Group at Wrocław University of Science and Technology for the discussion that improved this work.

Experimental setup {#appendix:experiment_setup}
==================

Data sets {#appendix:data_sets}
---------

Eight data sets on real-world complex networks were used for the research: Digg, Irvine Messages, Loans, Facebook, MIT, Slashdot, Infectious, and Twitter. Each data set was described using 88 features, where six classes (event types) were distinguished, in order to predict group changes. The process of transforming the temporal network into the groups described by features was carried out using the Group Evolution Prediction (GEP) method [@saganowski2019gep]. All data sets are publicly available [@saganowski2018data]. Each data set has a different number of observations and a different class imbalance ratio. The imbalance ratio of each data set is presented in Figure \[datasets\_IR\] and in Appendix \[appendix:results\_by\_class\].

Additionally, two tumor data sets have been used, one related to breast tumor (BRE) [@dataset_BRE], and the other one related to prostate tumor (PRO) [@dataset_PRO]. The BRE data set included 30 features, while the PRO data set only 8. Therefore, we have selected from the BRE data only features that were present in the PRO data.

![Distribution of imbalance ratio in the surveyed datasets.[]{data-label="datasets_IR"}](Figures/data_ir.png){width="0.7\linewidth"}

Classifiers used {#appendix:classifiers_used}
----------------

The study selected seven classifiers: AdaBoost (AB), Decision Tree (DT), k-nearest neighbors classifier (kNN), Random Forest (RF), Support Vector Machine (SVM), Naive Bayes classifier (NB), and Neural Network (NN), as these are the most often used in the CIP [@haixiang2017learning]. Each of them has been implemented using the scikit-learn package. Parameters of each classifier were constant between data sets. Each of the parameters was selected sequentially based on 10-fold cross-validation, by averaging the results obtained on all examined data sets repeated ten times. Classifier parameters were as follows:

-   k-nearest neighbors classifier

    -   Number of neighbors: 3

    -   Distance metric: minkowski

    -   Weight function used in prediction: uniform

    -   Other parameters such as the default values for KNeighborsClassifier in scikit-learn package

-   Support Vector Machine

    -   Penalty parameter C of the error term: 0.001

    -   Kernel type: linear

    -   Hard limit on iterations within solver: 1000

    -   Tolerance for stopping criterion: 0.001

    -   Other parameters such as the default values for SVC in scikit-learn package

-   Decision Tree

    -   Criterion: gini

    -   The minimum number of samples required to split an internal node: 2

    -   The minimum number of samples required to be at a leaf node: 1

    -   The maximum depth of the tree: 30

    -   Other parameters such as the default values for DecisionTreeClassifier in scikit-learn package

-   Random Forest

    -   Criterion: gini

    -   The number of trees in the forest: 10

    -   The minimum number of samples required to split an internal node: 2

    -   The minimum number of samples required to be at a leaf node: 1

    -   The maximum depth of the tree: 30

    -   Other parameters such as the default values for RandomForestClassifier in scikit-learn package

-   Neural Network

    -   Number of hidden layers: 1

    -   Number of neurons in hidden layers: 150

    -   Activation function: ReLU

    -   Optimizer: Adam

    -   Initial learning rate: 0.001

    -   L2 penalty: 0.0001

    -   Maximum number of iterations: 1000

    -   Other parameters such as the default values for MLPClassifier in scikit-learn package

-   AdaBoost

    -   Base estimator: Decision Tree

    -   Number of estimators: 10

    -   Learning rate: 1.0

    -   Other parameters such as the default values for AdaBoostClassifier in scikit-learn package

-   AdaBoost

    -   Parameters such as the default values for GaussianNB in scikit-learn package

Classification quality measure {#appendix:classification_measure}
------------------------------

The most commonly used measures to determine the evaluation achievements, adapted to the problem of unbalanced data, include [@haixiang2017learning]: Receiver Operating Characteristics, G-Mean, and F-measure. This is due to the reduced susceptibility to imbalanced data distribution, caused by the inclusion of class distribution in the calculation of the measure. To determine the effectiveness of the classification in our study, the F-measure averaged over all classes is used. The plain average over all classes is equally affected by all classes; thus, very well reflects the overall quality of the predictions of the considered data sets. Additional arguments for using the F-measure averaged over all classes are stated in [@saganowski2019gep].

Validation {#appendix:validation}
----------

We have applied the stratified 10-fold cross-validation method for the validation process. The small exception to this was the Infectious data set, for which a stratified 4-fold cross-validation has been applied, as there were only four observations in the minority class.

To eliminate the randomness of some methods, experiments were repeated many times, and the results were averaged. The detailed validation process for each considered technique was as follows:

-   Base score, RUS, ROS - experiments were repeated 50 times, and the final result was the average of all attempts.

-   SMOTE, bSMOTE, SMOTE-ENN, SMOTE-TL, ADASYN - at first the number of nearest neighbors parameter was adjusted. For each value from the set {1, 2, ..., 10} 10 classification attempts were performed, and results were averaged. The value that resulted in the best classification quality was selected for the experiment. The experiment was repeated 50 times, and the final result was the average of all attempts. For each data set, this procedure was conducted separately.

-   MC-RBO - similarly to SMOTE, but the best value for the number of nearest neighbors parameter was selected from the set {1, 2, ..., 10, 15, 20, ..., 50}. The number of attempts was the same.

-   IHT - averaging 50 attempts to balance the data set with the Random Forest as the estimator and 10-fold cross-validation

Let us also emphasize that in the case of RanE, SemE, and SupE, the external observations are added only to the training set, see Fig \[fig\_enriching\_procedure\]. The test set and the validation set (used only in SemE) are kept untouched, i.e., contain only observations from the base set.

![The validation procedure. The external observations are added only to the training set.[]{data-label="fig_enriching_procedure"}](Figures/enriching_procedure.png){width="0.7\linewidth"}

Reproducibility {#appendix:reproducibility}
---------------

The implementations of methods used in the experiments are publicly available at:

-   RanE, SemE, and SupE methods: <https://github.com/HJegierski/DataEnrichment>

-   MC-RBO method: <https://github.com/michalkoziarski/MultiClassRBO/blob/master/algorithms.py>

-   Other state-of-the-art data balancing methods: <https://imbalanced-learn.readthedocs.io/en/stable/index.html>

-   Classifiers: <https://scikit-learn.org/stable/>

RanE additional results {#appendix:rane_full_results}
=======================

The study of the influence of RanE on the correctness of prediction was carried out for all considered data sets; however, the MIT set was the most susceptible to the influence of the developed method. Table \[tab\_rane\_classifiers\] shows the influence of the enrichment amount and the classifier selected, on the classification quality enhancement. The first row is the reference point and determines the correctness of the classifier prediction without enrichment. The green color marks cases where the enrichment positively affected the improvement of prediction, while red marks preservation or deterioration of prediction. The best value for each classifier is highlighted in bold font, while the yellow color marks the best performance among all classifiers.

The top three classifiers were the Decision Tree (0.252), AdaBoost (0.243), and Random Forests (0.233). The enrichment allowed to increase the correctness of the classification of each classifier, where the highest profit was in the case of the Neural Networks, reaching 24%. Let us emphasize that for each classifier, there was an enrichment set that improved the prediction quality.

[c|MMMMMMM]{} &\
(lr)[2-8]{} & **kNN** & **SVM** & **DT** & **RF** & **NN** & **AB** & **NB**\
0% & 0.182 & 0.180 & 0.210 & 0.206 & 0.193 & 0.225 & 0.127\
10% & **0.187 +3%** & 0.165 -8% & 0.233 +11% & 0.199 -3% & 0.217 +12% & 0.207 -8% & 0.150 +18%\
20% & 0.177 -3% & 0.180 +0% & 0.215 +2% & 0.205 -0% & 0.226 +17% & **0.243 +8%** & 0.151 +19%\
30% & 0.168 -8% & 0.169 -6% & 0.220 +5% & 0.210 +2% & **0.239 +24%** & 0.221 -2% & 0.154 +21%\
40% & 0.169 -7% & 0.174 -3% & 0.242 +15% & **0.233 +13%** & 0.222 +15% & 0.222 -1% & **0.171 +35%**\
50% & 0.168 -8% & 0.167 -7% & 0.233 +11% & 0.209 +1% & 0.221 +15% & 0.226 +0% & **0.171 +35%**\
60% & 0.168 -8% & 0.175 -3% & 0.225 +7% & 0.208 +1% & 0.221 +15% & 0.216 -4% & **0.171 +35%**\
70% & 0.168 -8% & 0.168 -7% & 0.249 +19% & 0.199 -3% & 0.217 +12% & 0.226 +0% & **0.171 +35%**\
80% & 0.168 -8% & 0.168 -7% & 0.243 +16% & 0.203 -1% & 0.232 +20% & 0.195 -13% & **0.171 +35%**\
90% & 0.168 -8% & 0.164 -9% & **0.252 +20%** & 0.197 -4% & 0.222 +15% & 0.215 -4% & **0.171 +35%**\
100% & 0.168 -8% & **0.181 +1%** & 0.235 +12% & 0.219 +6% & 0.221 +15% & 0.232 +3% & **0.171 +35%**\

SemE additional results {#appendix:seme_full_results}
=======================

[L|NNNNNNN]{} &\
(lr)[2-8]{} & **Digg** & **Irvine Messages** & **Loans** & **Facebook** & **MIT** & **Infectious** & **Twitter**\
None & 0.219 & 0.220 & 0.188 & 0.255 & 0.210 & 0.278 & 0.183\
Digg & & 0.226 +3% & 0.197 +5% & 0.256 +0% & 0.265 +26% & 0.326 +17% & 0.194 +6%\
Irvine Messages & 0.231 +5% & & 0.204 +9% & 0.265 +4% & 0.245 +17% & 0.332 +19% & 0.195 +7%\
Loans & 0.221 +1% & 0.230 +5% & & 0.262 +3% & 0.234 +11% & 0.298 +7% & 0.192 +5%\
Facebook & 0.231 +5% & 0.236 +7% & 0.213 +13% & & 0.240 +14% & 0.285 +3% & **0.197 +8%**\
MIT & 0.223 +2% & 0.225 +2% & 0.197 +5% & 0.258 +1% & & 0.340 +22% & 0.190 +4%\
Infectious & 0.232 +6% & 0.230 +5% & 0.192 +2% & 0.266 +4% & 0.253 +20% & & 0.191 +4%\
Twitter & **0.238 +9%** & **0.251 +14%** & **0.214 +14%** & **0.271 +6%** & **0.300 +43%** & **0.346 +24%** &\

Statistical analysis {#appendix:statistical_analysis}
====================

The comparison of the average F-measures obtained by $N$ methods for $M$ data sets was carried out according to the Friedman rank test [@friedman1937use], which is used to detect differences between more than two variables in many test samples. The result of such a test only determines the occurrence of differences between the averages compared; therefore, an ad-hoc comparison should be carried out, which will indicate pairs of averages that differ in a statistically significant way. For this purpose, Shaffer’s post-hoc multiple comparisons test [@shaffer1986modified] was used. Non-parametric statistical analysis was calculated using the KEEL tool [@alcala2009keel].

The Friedman procedure was carried out on the results presented in Tables \[tab\_comparison1\] and \[tab\_cancer\] (BRE with eight features and PRO). This includes all ten data sets considered in our work. The average ranks obtained with the Friedman test are presented in Table \[tab\_friedman\]. The test determined p-value=$4.92*10^{-10}$, which is much lower than 0.05. Thus, the obtained value confirms the statistical significance of the obtained results. As expected, SupE was ranked first, followed by the SemE, bSMOTE, and RanE methods. The results of the Shaffer’s multiple post-hoc comparisons for $\alpha=0.05$ are presented in Table \[tab\_shaffer\]; only the statistically significant comparisons are included. The comparison showed that the differences between the developed methods and no balancing of the set were statistically significant, in contrast to the other methods, the differences of which compared to the lack of balancing were not statistically significant. This confirms the positive influence of the developed techniques on the quality of classification.

   **Data set balancing algorithm**   **Rank**
  ---------------------------------- ----------
                 SupE                   1.15
                 SemE                   3.05
                bSMOTE                  3.9
                 RanE                   5.05
               SMOTE-TL                 5.5
                SMOTE                   6.1
                 ROS                    6.3
              SMOTE-ENN                 7.85
                 None                   8.05
                 IHT                    8.85
                 RUS                    10.2

  : The average ranks of data set balancing algorithms obtained using the Friedman test.[]{data-label="tab_friedman"}

   **Dataset balancing algorithm**   **p value**
  --------------------------------- -------------
            SupE vs. RUS                  0
            SupE vs. IHT                  0
            SemE vs. RUS              0.000001
            SupE vs. None             0.000003
         SupE vs. SMOTE-ENN           0.000006
           bSMOTE vs. RUS             0.000022
            SemE vs. IHT              0.000092
            RanE vs. RUS              0.000516
            SupE vs. ROS              0.000516
            SemE vs. None             0.000749
           bSMOTE vs. IHT             0.000846
           SupE vs. SMOTE             0.000846
         SemE vs. SMOTE-ENN           0.001211
          RUS vs. SMOTE-TL            0.001531
          SupE vs. SMOTE-TL            0.00336
           bSMOTE vs. None            0.005143
            RUS vs. SMOTE             0.005706
        bSMOTE vs. SMOTE-ENN          0.007743
             RUS vs. ROS              0.008554
            SupE vs. RanE             0.008554
            RanE vs. IHT              0.010408
          SMOTE-TL vs. IHT             0.02391
            SemE vs. ROS              0.028441
           SemE vs. SMOTE             0.039753
            RanE vs. None             0.043114

  : The Shaffer post-hoc multiple comparisons of different balancing datasets algorithms for $\alpha=0.05$. Only the hypotheses with p-value above $0.05$ are presented.[]{data-label="tab_shaffer"}

Combining enriching with bSMOTE {#appendix:combining_bsmote}
===============================

To evaluate if our solutions can be successfully combined with other balancing methods, we have mixed SemE and SupE with bSMOTE. The bSMOTE method has been chosen as it performed best among the examined state-of-the-art methods. Table \[tab\_seme\_smote\] contains the results of combining SemE with bSMOTE. Please note that percentages and cells’ colors in Table \[tab\_seme\_smote\] are calculated with respect to Table \[tab\_semE\] (the sole SemE), not the baseline (the classification result without the balancing algorithm). Therefore, it is visible that, in most cases, the bSMOTE further improved the result of SemE.

On the contrary, mixing SupE with bSMOTE has significantly worsened the results with respect to the sole SupE results; see Table \[tab\_enr\_bsmote\]. Such results suggest that enriching the base set with the SemE approach leaves some space for establishing a better border between classes. This is possible because a single iteration (semi-greedy) over the external observations does not exhaust the full potential of external information (observations). Meanwhile, the sole SupE (with extra SemE step if necessary) helps to establish a well-positioned border. Therefore, adding bSMOTE on top of this, only results in over-fitting, as there are too many examples near the border.

[L|MMMMMMMM]{} &\
(lr)[2-9]{} & **Digg** & **Irvine Messages** & **Loans** & **Facebook** & **MIT** & **Slashdot** & **Infectious** & **Twitter**\
**None** & 0.226 & 0.212 & 0.180 & 0.260 & 0.206 & 0.249 & 0.250 & 0.191\
**Digg** & & 0.239 +11% & 0.198 +0% & 0.292 +9% & 0.244 +6% & 0.265 +0% & 0.335 +0% & 0.204 +1%\
**Irvine Messages** & 0.246 +4% & & 0.199 -4% & 0.293 +11% & 0.275 +21% & 0.264 +0% & 0.361 +15% & 0.196 -1%\
**Loans** & 0.253 +10% & 0.231 +6% & & 0.293 +12% & 0.284 +19% & 0.268 +1% & 0.325 +1% & 0.199 +1%\
**Facebook** & 0.247 +8% & 0.247 +14% & 0.199 +1% & & 0.288 +18% & 0.271 +2% & 0.351 +10% & 0.200 -2%\
**MIT** & 0.249 +8% & 0.232 +4% & 0.207 +6% & 0.292 +12% & & 0.271 +3% & 0.340 +27% & 0.205 +4%\
**Slashdot** & 0.244 +2% & 0.250 +1% & 0.217 +1% & 0.272 +0% & 0.241 -9% & & 0.322 -4% & 0.199 +3%\
**Infectious** & 0.248 +6% & 0.244 +5% & 0.203 +5% & 0.292 +10% & 0.252 +0% & 0.264 +1% & & 0.200 +3%\
**Twitter** & 0.244 +2% & 0.232 -4% & 0.198 +4% & 0.293 +6% & 0.270 -6% & 0.261 -2% & 0.360 +3% &\

[L|MMMMMMMM]{} &\
(lr)[2-9]{} & **Digg** & **Irvine Messages** & **Loans** & **Facebook** & **MIT** & **Slashdot** & **Infectious** & **Twitter**\
**None** & 0.226 & 0.212 & 0.180 & 0.260 & 0.206 & 0.249 & 0.250 & 0.191\
**SemE** & 0.240 +6% & 0.248 +17% & 0.214 +19% & 0.277 +7% & 0.288 +40% & 0.266 +7% & 0.349 +40% & 0.204 +7%\
**SemE + bSMOTE** & 0.253 +12% & 0.250 +18% & 0.217 +21% & 0.293 +13% & 0.288 +40% & 0.271 +9% & 0.361 +44% & 0.205 +7%\
**SupE** & **0.268 +19%** & **0.259 +22%** & **0.230 +28%** & **0.294 +13%** & **0.301 +46%** & **0.278 +12%** & **0.415 +66%** & **0.213 +12%**\
**SupE + bSMOTE** & 0.247 +9% & 0.236 +11% & 0.190 +6% & **0.294 +13%** & 0.246 +19% & 0.261 +5% & 0.321 +28% & 0.198 +4%\

Classification results by class {#appendix:results_by_class}
===============================

[l|rrrrrrrrrrrr|MO]{}\
& & &\
& & & & & & & &\
Count & & & & & & & &\
IR & & & & & & & &\
None & 0.490 & & 0.000 & & 0.366 & & 0.020 & & 0.482 & & 0.000 & & 0.226 &\
RUS & 0.384 & -22% & 0.022 & NaN & 0.263 & -28% & 0.070 & 250% & 0.391 & -19% & 0.079 & NaN & 0.202 & -11%\
ROS & 0.465 & -5% & 0.006 & NaN & 0.355 & -3% & 0.034 & 70% & 0.474 & -2% & 0.027 & NaN & 0.227 & 0%\
SM & 0.441 & -10% & 0.004 & NaN & 0.356 & -3% & 0.048 & 140% & 0.481 & 0% & 0.054 & NaN & 0.231 & 2%\
bSM & 0.488 & 0% & 0.004 & NaN & 0.377 & 3% & 0.049 & 145% & 0.482 & 0% & 0.066 & NaN & 0.244 & 8%\
SM-ENN & 0.543 & 11% & 0.005 & NaN & 0.212 & -42% & 0.045 & 125% & 0.469 & -3% & 0.069 & NaN & 0.224 & -1%\
SM-TL & 0.521 & 6% & 0.005 & NaN & 0.324 & -11% & 0.040 & 100% & 0.481 & 0% & 0.054 & NaN & 0.238 & 5%\
IHT & 0.158 & -68% & 0.015 & NaN & 0.246 & -33% & 0.085 & 325% & 0.280 & -42% & 0.070 & NaN & 0.142 & -37%\
RanE & 0.505 & 3% & 0.000 & NaN & 0.385 & 5% & 0.016 & -20% & 0.481 & 0% & 0.004 & NaN & 0.232 & 3%\
SemE & 0.505 & 3% & 0.028 & NaN & 0.385 & 5% & 0.014 & -30% & 0.481 & 0% & 0.027 & NaN & 0.240 & 6%\
SupE & 0.505 & 3% & 0.198 & NaN & 0.385 & 5% & 0.037 & 85% & 0.481 & 0% & 0.000 & NaN & 0.268 & 19%\

\[tab:addlabel\]

[l|rrrrrrrrrrrr|MO]{}\
& & &\
& & & & & & & &\
Count & & & & & & & &\
IR & & & & & & & &\
None & 0.184 & & 0.230 & & 0.267 & & 0.061 & & 0.532 & & 0.000 & & 0.212 &\
RUS & 0.217 & 18% & 0.176 & -23% & 0.196 & -27% & 0.077 & 26% & 0.338 & -36% & 0.112 & NaN & 0.186 & -12%\
ROS & 0.198 & 8% & 0.213 & -7% & 0.281 & 5% & 0.094 & 54% & 0.530 & 0% & 0.026 & NaN & 0.224 & 6%\
SM & 0.197 & 7% & 0.224 & -3% & 0.294 & 10% & 0.094 & 54% & 0.522 & -2% & 0.072 & NaN & 0.234 & 10%\
bSM & 0.192 & 4% & 0.226 & -2% & 0.285 & 7% & 0.089 & 46% & 0.514 & -3% & 0.069 & NaN & 0.229 & 8%\
SM-ENN & 0.280 & 52% & 0.084 & -63% & 0.253 & -5% & 0.087 & 43% & 0.509 & -4% & 0.117 & NaN & 0.222 & 5%\
SM-TL & 0.217 & 18% & 0.179 & -22% & 0.280 & 5% & 0.076 & 25% & 0.529 & -1% & 0.082 & NaN & 0.227 & 7%\
IHT & 0.223 & 21% & 0.105 & -54% & 0.208 & -22% & 0.084 & 38% & 0.340 & -36% & 0.101 & NaN & 0.177 & -17%\
RanE & 0.171 & -7% & 0.230 & 0% & 0.319 & 19% & 0.052 & -15% & 0.526 & -1% & 0.068 & NaN & 0.228 & 8%\
SemE & 0.179 & -3% & 0.256 & 11% & 0.278 & 4% & 0.087 & 43% & 0.546 & 3% & 0.141 & NaN & 0.248 & 17%\
SupE & 0.196 & 7% & 0.249 & 8% & 0.292 & 9% & 0.174 & 185% & 0.546 & 3% & 0.094 & NaN & 0.259 & 22%\

\[tab:addlabel\]

[l|rrrrrrrrrrrr|MO]{}\
& & &\
& & & & & & & &\
Count & & & & & & & &\
IR & & & & & & & &\
None & 0.038 & & 0.638 & & 0.207 & & 0.061 & & 0.193 & & 0.000 & & 0.180 &\
RUS & 0.091 & 139% & 0.212 & -67% & 0.122 & -41% & 0.000 & NaN & 0.114 & -41% & 0.034 & NaN & 0.098 & -46%\
ROS & 0.070 & 84% & 0.591 & -7% & 0.260 & 26% & 0.012 & -80% & 0.248 & 28% & 0.021 & NaN & 0.199 & 11%\
SM & 0.081 & 113% & 0.532 & -17% & 0.260 & 26% & 0.001 & -98% & 0.260 & 35% & 0.057 & NaN & 0.201 & 12%\
bSM & 0.086 & 126% & 0.537 & -16% & 0.262 & 27% & 0.016 & -74% & 0.266 & 38% & 0.002 & NaN & 0.193 & 7%\
SM-ENN & 0.099 & 161% & 0.375 & -41% & 0.305 & 47% & 0.003 & -95% & 0.307 & 59% & 0.043 & NaN & 0.189 & 5%\
SM-TL & 0.083 & 118% & 0.543 & -15% & 0.262 & 27% & 0.007 & -89% & 0.257 & 33% & 0.042 & NaN & 0.198 & 10%\
IHT & 0.125 & 229% & 0.291 & -54% & 0.203 & -2% & 0.001 & -98% & 0.263 & 36% & 0.035 & NaN & 0.155 & -14%\
RanE & 0.042 & 11% & 0.678 & 6% & 0.222 & 7% & 0.012 & -80% & 0.189 & -2% & 0.000 & 0% & 0.189 & 5%\
SemE & 0.077 & 103% & 0.689 & 8% & 0.243 & 17% & 0.000 & NaN & 0.181 & -6% & 0.093 & NaN & 0.214 & 19%\
SupE & 0.128 & 237% & 0.689 & 8% & 0.258 & 25% & 0.000 & NaN & 0.189 & -2% & 0.116 & NaN & 0.230 & 28%\

\[tab:addlabel\]

[l|rrrrrrrrrrrr|MO]{}\
& & &\
& & & & & & & &\
Count & & & & & & & &\
IR & & & & & & & &\
None & 0.196 & & 0.349 & & 0.393 & & 0.013 & & 0.585 & & 0.023 & & 0.260 &\
RUS & 0.121 & -38% & 0.280 & -20% & 0.227 & -42% & 0.089 & 585% & 0.308 & -47% & 0.092 & 300% & 0.186 & -28%\
ROS & 0.223 & 14% & 0.323 & -7% & 0.347 & -12% & 0.069 & 431% & 0.531 & -9% & 0.071 & 209% & 0.261 & 0%\
SM & 0.216 & 10% & 0.316 & -9% & 0.349 & -11% & 0.075 & 477% & 0.520 & -11% & 0.116 & 404% & 0.265 & 2%\
bSM & 0.218 & 11% & 0.359 & 3% & 0.363 & -8% & 0.080 & 515% & 0.548 & -6% & 0.158 & 587% & 0.288 & 11%\
SM-ENN & 0.279 & 42% & 0.317 & -9% & 0.205 & -48% & 0.103 & 692% & 0.503 & -14% & 0.164 & 613% & 0.262 & 1%\
SM-TL & 0.249 & 27% & 0.344 & -1% & 0.340 & -13% & 0.081 & 523% & 0.553 & -5% & 0.145 & 530% & 0.286 & 10%\
IHT & 0.265 & 35% & 0.287 & -18% & 0.257 & -35% & 0.108 & 731% & 0.368 & -37% & 0.102 & 343% & 0.231 & -11%\
RanE & 0.200 & 2% & 0.358 & 3% & 0.402 & 2% & 0.036 & 177% & 0.609 & 4% & 0.018 & -22% & 0.271 & 4%\
SemE & 0.215 & 10% & 0.366 & 5% & 0.402 & 2% & 0.055 & 323% & 0.609 & 4% & 0.016 & -30% & 0.277 & 7%\
SupE & 0.243 & 24% & 0.363 & 4% & 0.404 & 3% & 0.097 & 646% & 0.607 & 4% & 0.050 & 117% & 0.294 & 13%\

\[tab:addlabel\]

[l|rrrrrrrrrrrr|MO]{}\
& & &\
& & & & & & & &\
Count & & & & & & & &\
IR & & & & & & & &\
None & 0.292 & & 0.038 & & 0.291 & & 0.154 & & 0.459 & & 0.000 & & 0.206 &\
RUS & 0.168 & -42% & 0.120 & 216% & 0.130 & -55% & 0.156 & 1% & 0.146 & -68% & 0.069 & NaN & 0.132 & -36%\
ROS & 0.258 & -12% & 0.159 & 318% & 0.269 & -8% & 0.133 & -14% & 0.360 & -22% & 0.072 & NaN & 0.209 & 1%\
SM & 0.275 & -6% & 0.215 & 466% & 0.244 & -16% & 0.177 & 15% & 0.356 & -22% & 0.088 & NaN & 0.226 & 10%\
bSM & 0.241 & -17% & 0.382 & 905% & 0.268 & -8% & 0.208 & 35% & 0.207 & -55% & 0.170 & NaN & 0.246 & 19%\
SM-ENN & 0.313 & 7% & 0.226 & 495% & 0.084 & -71% & 0.126 & -18% & 0.125 & -73% & 0.130 & NaN & 0.167 & -19%\
SM-TL & 0.278 & -5% & 0.197 & 418% & 0.199 & -32% & 0.140 & -9% & 0.291 & -37% & 0.099 & NaN & 0.201 & -2%\
IHT & 0.263 & -10% & 0.191 & 403% & 0.236 & -19% & 0.131 & -15% & 0.292 & -36% & 0.121 & NaN & 0.206 & 0%\
RanE & 0.300 & 3% & 0.139 & 266% & 0.264 & -9% & 0.134 & -13% & 0.488 & 6% & 0.074 & NaN & 0.233 & 13%\
SemE & 0.308 & 5% & 0.245 & 545% & 0.352 & 21% & 0.156 & 1% & 0.498 & 8% & 0.167 & NaN & 0.288 & 40%\
SupE & 0.292 & 0% & 0.391 & 929% & 0.305 & 5% & 0.234 & 52% & 0.419 & -9% & 0.167 & NaN & 0.301 & 46%\

\[tab:addlabel\]

[l|rrrrrrrrrrrr|MO]{}\
& & &\
& & & & & & & &\
Count & & & & & & & &\
IR & & & & & & & &\
None & 0.671 & & 0.013 & & 0.253 & & 0.064 & & 0.335 & & 0.158 & & 0.249 &\
RUS & 0.511 & -24% & 0.029 & 123% & 0.218 & -14% & 0.101 & 58% & 0.293 & -13% & 0.088 & -44% & 0.207 & -17%\
ROS & 0.712 & 6% & 0.022 & 69% & 0.248 & -2% & 0.062 & -3% & 0.359 & 7% & 0.204 & 29% & 0.268 & 8%\
SM & 0.719 & 7% & 0.015 & 15% & 0.249 & -2% & 0.079 & 23% & 0.374 & 12% & 0.189 & 20% & 0.271 & 9%\
bSM & 0.722 & 8% & 0.014 & 8% & 0.238 & -6% & 0.110 & 72% & 0.398 & 19% & 0.187 & 18% & 0.278 & 12%\
SM-ENN & 0.734 & 9% & 0.018 & 38% & 0.222 & -12% & 0.081 & 27% & 0.384 & 15% & 0.193 & 22% & 0.272 & 9%\
SM-TL & 0.729 & 9% & 0.024 & 85% & 0.235 & -7% & 0.083 & 30% & 0.387 & 16% & 0.188 & 19% & 0.274 & 10%\
IHT & 0.480 & -28% & 0.016 & 23% & 0.238 & -6% & 0.114 & 78% & 0.224 & -33% & 0.075 & -53% & 0.191 & -23%\
RanE & 0.741 & 10% & 0.000 & NaN & 0.207 & -18% & 0.033 & -48% & 0.336 & 0% & 0.214 & 35% & 0.255 & 2%\
SemE & 0.679 & 1% & 0.038 & 192% & 0.253 & 0% & 0.091 & 42% & 0.339 & 1% & 0.194 & 23% & 0.266 & 7%\
SupE & 0.679 & 1% & 0.125 & 862% & 0.248 & -2% & 0.105 & 64% & 0.337 & 1% & 0.171 & 8% & 0.278 & 12%\

\[tab:addlabel\]

[l|rrrrrrrrrrrr|MO]{}\
& & &\
& & & & & & & &\
Count & & & & & & & &\
IR & & & & & & & &\
None & 0.375 & & 0.515 & & 0.140 & & 0.000 & & 0.467 & & 0.000 & & 0.250 &\
RUS & 0.124 & -67% & 0.239 & -54% & 0.167 & 19% & 0.123 & NaN & 0.331 & -29% & 0.117 & NaN & 0.184 & -26%\
ROS & 0.399 & 6% & 0.271 & -47% & 0.162 & 16% & 0.087 & NaN & 0.492 & 5% & 0.005 & NaN & 0.236 & -6%\
SM & 0.358 & -5% & 0.313 & -39% & 0.133 & -5% & 0.091 & NaN & 0.381 & -18% & 0.003 & NaN & 0.213 & -15%\
bSM & 0.407 & 9% & 0.397 & -23% & 0.175 & 25% & 0.070 & NaN & 0.567 & 21% & 0.000 & 0% & 0.270 & 8%\
SM-ENN & 0.320 & -15% & 0.039 & -92% & 0.071 & -49% & 0.094 & NaN & 0.414 & -11% & 0.119 & NaN & 0.176 & -30%\
SM-TL & 0.383 & 2% & 0.319 & -38% & 0.150 & 7% & 0.101 & NaN & 0.520 & 11% & 0.008 & NaN & 0.247 & -1%\
IHT & 0.291 & -22% & 0.301 & -42% & 0.136 & -3% & 0.052 & NaN & 0.433 & -7% & 0.102 & NaN & 0.219 & -12%\
RanE & 0.542 & 45% & 0.498 & -3% & 0.127 & -9% & 0.000 & 0% & 0.588 & 26% & 0.000 & 0% & 0.293 & 17%\
SemE & 0.437 & 17% & 0.520 & 1% & 0.223 & 59% & 0.292 & NaN & 0.623 & 33% & 0.000 & 0% & 0.349 & 40%\
SupE & 0.433 & 15% & 0.482 & -6% & 0.076 & -46% & 0.530 & NaN & 0.720 & 54% & 0.250 & NaN & 0.415 & 66%\

\[tab:addlabel\]

[l|rrrrrrrrrrrr|MO]{}\
& & &\
& & & & & & & &\
Count & & & & & & & &\
IR & & & & & & & &\
None & 0.177 & & 0.336 & & 0.264 & & 0.012 & & 0.291 & & 0.064 & & 0.191 &\
RUS & 0.182 & 3% & 0.230 & -32% & 0.210 & -20% & 0.092 & 667% & 0.137 & -53% & 0.194 & 203% & 0.174 & -9%\
ROS & 0.165 & -7% & 0.267 & -21% & 0.204 & -23% & 0.047 & 292% & 0.200 & -31% & 0.086 & 34% & 0.162 & -15%\
SM & 0.158 & -11% & 0.222 & -34% & 0.182 & -31% & 0.053 & 342% & 0.212 & -27% & 0.122 & 91% & 0.158 & -17%\
bSM & 0.222 & 25% & 0.346 & 3% & 0.265 & 0% & 0.020 & 67% & 0.290 & 0% & 0.082 & 28% & 0.204 & 7%\
SM-ENN & 0.229 & 29% & 0.266 & -21% & 0.219 & -17% & 0.075 & 525% & 0.211 & -27% & 0.159 & 148% & 0.193 & 1%\
SM-TL & 0.258 & 46% & 0.293 & -13% & 0.201 & -24% & 0.058 & 383% & 0.215 & -26% & 0.126 & 97% & 0.192 & 1%\
IHT & 0.212 & 20% & 0.271 & -19% & 0.237 & -10% & 0.107 & 792% & 0.216 & -26% & 0.175 & 173% & 0.203 & 6%\
RanE & 0.216 & 22% & 0.342 & 2% & 0.241 & -9% & 0.054 & 350% & 0.232 & -20% & 0.082 & 28% & 0.195 & 2%\
SemE & 0.174 & -2% & 0.359 & 7% & 0.264 & 0% & 0.032 & 167% & 0.306 & 5% & 0.088 & 38% & 0.204 & 7%\
SupE & 0.192 & 8% & 0.342 & 2% & 0.264 & 0% & 0.083 & 592% & 0.306 & 5% & 0.088 & 38% & 0.213 & 12%\

\[tab:addlabel\]

Enriching vs. Transfer Learning {#appendix:transfer_learning}
===============================

Table \[tab\_comparison\_tl\] contains the results of the initial comparison of the Transfer Learning (TL) technique with the enriching approach. The comparison was conducted for the smallest data sets, Infectious and MIT. The model was transferred from the Twitter data set. The RanE, SemE, and SupE methods also use the Twitter data set as the external data set. The TL technique allowed us to achieve a better result than the baseline and the RanE method but was unable to surpass SemE and SupE. Nevertheless, TL performance was very satisfactory. The reason for this might be a particular data set, i.e., the Infectious and MIT data sets have critically underrepresented minority classes; hence, the classifier was unable to learn from them. Using an external data set, with more examples, turned out to be better than learning from the original data. Perhaps, applying TL to bigger data sets would not yield such spectacular results.

  ------------- ---------------- ----------------
                                 
   (lr)[2-3]{}      **MIT**       **Infectious**
      None           0.206            0.250
    **RanE**       0.233 +13%       0.293 +17%
    **SemE**       0.288 +40%       0.349 +40%
    **SupE**     **0.301 +46%**   **0.415 +66%**
     **TL**        0.261 +27%       0.312 +25%
  ------------- ---------------- ----------------

  : The comparison of RanE, SemE, and SupE with the Transfer Learning technique on the MIT and Infectious data sets. For all methods, the Twitter data set was used as the external data set. The classification executed with the Random Forest classifier and the F-measure averaged over all classes as the quality measure. Cells marked green indicate an improved classification quality, while cells marked red depict worse results. The best result for each data set is bolded and marked yellow.[]{data-label="tab_comparison_tl"}
