# A Hybrid Sampling SVM Approach to Imbalanced Data Classification

Authors: Qiang Wang
Journal: Abstract and Applied Analysis
 (2014)

---

## Abstract

Imbalanced datasets are frequently found in many real applications. Resampling is one of the effective solutions due to generating a relatively balanced class distribution. In this paper, a hybrid sampling SVM approach is proposed combining an oversampling technique and an undersampling technique for addressing the imbalanced data classification problem. The proposed approach first uses an undersampling technique to delete some samples of the majority class with less classification information and then applies an oversampling technique to gradually create some new positive samples. Thus, a balanced training dataset is generated to replace the original imbalanced training dataset. Finally, through experimental results on the real-world datasets, our proposed approach has the ability to identify informative samples and deal with the imbalanced data classification problem.


---

## Body

## 1. Introduction

In the literature and in real-world problems, the scenario of imbalanced data distribution appears when the size of samples in one class is greatly larger than the size of samples in the other class. Many applications such as fraud detection, intrusion prevention, risk management, and medical research often have the imbalanced class distribution problem. Classifiers constructed based on imbalanced datasets usually perform well on the majority class data but poorly on the minority class data [1]. However, in many cases, the minority class data are the most important ones to detect, for example, in the medical field for disease diagnosis or in the industrial field for fault diagnosis.Class imbalance has been appointed as one of the most challenging problems in the data mining field [2]. Many traditional classification methods tend to be overwhelmed by the majority class and ignore the minority class. Their classification performances on the minority class are negatively affected. Actually, these traditional classifiers, such as support vector machine (SVM), decision trees, and neural networks, are designed to optimize the overall performance on the whole dataset. In order to cope with the class imbalance problem, researchers have proposed many methods from the view of data-level approaches and algorithmic approaches. The data-level approaches balance the training dataset of the classifier by resampling techniques, while the algorithmic approaches deal with the development of new algorithms expressly designed to cope with uneven datasets. The two approaches are independent of each other and can be combined to enhance each other’s performance [3].Resampling is one of the effective approaches for balancing the training dataset of a classifier, which includes undersampling and oversampling techniques. In this paper, a new hybrid sampling approach combining oversampling and undersampling is presented to address the class imbalance problem. The proposed approach first uses undersampling to delete some samples of the majority class with less classification information and then applies oversampling to gradually create some new positive samples. Thus, a balanced training dataset is generated to replace the original imbalanced training dataset. Through experimental results on the real-world datasets, our approach has the ability to identify informative samples and deal with the imbalanced data classification problem. In addition, the proposed approach selects SVM as a base classifier. As we have known, SVM is one of the effective approaches for solving pattern recognition problems, which is an approximate implementation of the structural risk minimization principal based on statistical learning theory (SLT) rather than the empirical risk minimization method [4].The rest of the paper is organized as follows. Section2 presents a comprehensive study on the class imbalance problem and discusses the existing class imbalance solutions. Section 3 gives a simple description of support vector machine and then proposes a hybrid sampling SVM approach for addressing class imbalance problem. In Section 4, we compare the performance of the proposed approach with the existing methods. Finally, Section 5 concludes this paper.


## 2. Related Work

Since many real applications have met the class imbalance problem, researchers have proposed several methods to solve this problem. In general, there are two kinds of approaches to cope with the class imbalance problem: data-level approaches and algorithmic approaches [2]. In this section, we will review some of the most effective methods that have been proposed within these two categories.At the data-level approaches, resampling is one of the effective approaches which can obtain a more or less balanced class distribution. The resampling techniques try to balance out the dataset either randomly or deterministically, which include undersampling methods, oversampling methods, and hybrid methods.Undersampling methods create a subset of the original dataset by randomly or selectively deleting some of the samples of the majority class while keeping the original population of the minority class [5, 6]. Despite the fact that this method results in information loss for the majority class, it must be noted that undersampling is generally quite successful at countering the class imbalance problem, especially when it uses sophisticated data elimination methods. EasyEnsemble and BalanceCascade proposed by Liu et al. [7] are two effective informed undersampling methods. Kim [8] proposes an undersampling method based on a self-organizing map (SOM) neural network to obtain sampling data which retains the original data characteristics. García and Herrera [9] present an evolutionary undersampling method for classification with imbalanced datasets. Yen and Lee [10] propose cluster-based undersampling approaches. Its basic idea is to select the representative data as training data, which improve the classification accuracy for minority class in the imbalanced class distribution environment.Oversampling methods [11] generate a superset of the original dataset by replicating some of the samples of the positive class or creating new samples from the original positive class instances. A widely used oversampling technique is called SMOTE (synthetic minority oversampling technique) [11], which creates new synthetic samples to the minority class by randomly interpolating pairs of the closest neighbors in the minority class. SMOTE is effective to increase the significance of the positive class in the decision region. There exist many methods based on the SMOTE for generating more appropriate instances [12]. Borderline-SMOTE [13] is another approach based on the synthetic generation of instances proposed in SMOTE. Gao et al. [14] propose probability density function estimation based oversampling approach for two-class imbalanced classification problems. RWO-sampling [15] is a random walk oversampling approach to balance different class samples by creating synthetic samples through randomly walking from the real data. RWO-sampling also expands the minority class boundary after synthetic samples have been generated.Hybrid methods use the oversampling technique combined with the undersampling technique to balance the class size. AdaOUBoost [16] adaptively oversamples the minority positive samples and undersamples the majority negative samples to form different subclassifiers and combines these subclassifiers according to their accuracy to create a strong classifier. Cateni et al. [17] present a new resampling approach to address the class imbalance problem, which combines a normal distribution-based oversampling technique and a similarity-based undersampling technique. Cao et al. [18] propose a hybrid probabilistic sampling combined with diverse random subspace ensemble for imbalanced data learning. Luengo et al. [19] analyze the usefulness of the data complexity measures and propose an approach based on SMOTE-based oversampling and evolutionary undersampling to deal with the class imbalance problem.Algorithmic approach is another way to deal with the imbalanced data problem, which tries to modify the classifiers to suit the imbalanced datasets. Cost-sensitive learning is an effective solution based on algorithmic approaches, which can improve the performance of classification by setting different misclassification cost to the majority and minority datasets. In the cost-sensitive framework, the costs of misclassifying minority samples are higher with respect to other kinds of errors in order to encourage their correct classification. Cost-sensitive learning is one of the most important topics in machine learning and data mining and has attracted high attention in recent years [3, 20, 21]. Many algorithms combining resampling and cost-sensitive learning have also been proposed [22].Many works make some modification of the classification algorithms. Several specific attempts using SVMs have been made to improve their class prediction accuracy in the case of class imbalances [23–26]. Fu and Lee [27] present a certainty-based active learning algorithm to deal with the imbalanced data classification problem. In order to improve the classification of imbalanced data, Oh [28] proposes a new error function for the error back-propagation algorithm of multilayer perceptrons.As we have known, in recent years, an ensemble of classifiers have arisen as a possible solution to the class imbalance problem attracting great interest among researchers because of their flexible characteristics [29, 30]. Ensembles are designed to increase the accuracy of a single classifier by training several different classifiers and combining their decisions to output a single class label. Liu et al. [31] present an ensemble of SVMs to improve the prediction performance, which incorporates both oversampling and undersampling. Guo and Viktor [32] present an approach DataBoost-IM, which generated new data and classified imbalanced data by an ensemble classifier. Oh et al. [33] propose an ensemble learning method combined with active example selection to deal with the class imbalance problem. Woźniak et al. [34] present ensemble classifiers from a new point of view including approaches to imbalanced data classification.


## 3. The Proposed Hybrid Sampling SVM Approach

In this section, we first give a description of support vector machine, and then we present our proposed approach.


### 3.1. Review of Support Vector Machine

SVM was first introduced to solve the pattern classification and regression problems by Vapnik and his colleagues [4, 35]. In recent years, SVM has drawn considerable attentions due to its high generalization ability of a wide range of applications and better performance than other traditional learning machines. The goal of the SVM learning algorithm is to find a separating hyperplane that separates these data points into two classes.Consider a binary classification problem consisting ofl training samples {
(
x
1
,
y
1
)
,
(
x
2
,
y
2
)
,
…
,
(
x
l
,
y
l
)
}, where x
i
=
(
x
i
1
,
x
i
2
,
…
,
x
i
d
)
T represents a d-dimensional data point and y
i
∈
{
+
1
,
-
1
} denotes its class label. The decision boundary of a linear classifier can be written in the following form:
(1)
w
·
x
+
b
=
0
,
wherew and b are parameters of the model. To have more flexible ways to deal with nonlinear separable data, we can first transform the training samples into a high-dimensional feature space using a nonlinear mapping Φ. Therefore, (1) can be rewritten as w
·
Φ
(
x
)
+
b
=
0.The support vector technique requires the solution of the following optimization problem:(2)
min
⁡
w
∥
w
∥
2
2
subject to y
i
(
w
·
Φ
(
x
i
)
+
b
)
≥
1, for i
=
1
,
…
,
l.This optimization problem can be solved by constructing a Lagrangian representation and transforming it into the following dual problem:(3)
L
D
=
∑
i
=
1
l
α
i
-
1
2
∑
i
=
1
l
∑
j
=
1
l
α
i
α
j
y
i
y
j
Φ
(
x
i
)
·
Φ
(
x
j
)
.Once allα
i are found using quadratic programming techniques, we can use the KKT conditions to express the optimal primal variablew in terms of the optimal dual variables, according to w
=
∑
i
=
1
l
α
i
y
i
Φ
(
x
i
). Note thatw depends only on the x
i for which α
i
≠
0, which are called thesupport vectors (SVs).When the optimal pair(
w
0
,
b
0
) is determined, the SVM decision function is then given by
(4)
f
(
x
)
=
sign
⁡
(
∑
i
∈
SVs
α
i
y
i
Φ
(
x
i
)
·
Φ
(
x
)
+
b
)
.Iff
(
x
)
=
1, then the test samplex is classified as a positive class; otherwise, it is classified as a negative class.Furthermore, the dot productΦ
(
x
i
)
·
Φ
(
x
j
) in the transformed space can be expressed as the kernel function K
(
x
i
,
x
j
)
=
Φ
(
x
i
)
·
Φ
(
x
j
). Thus, the kernel is the key that determines the performance of the SVM. Several typical kernel functions are the lineal kernel K
(
x
i
,
x
j
)
=
x
i
·
x
j, the polynomial kernel K
(
x
i
,
x
j
)
=
(
a
x
i
T
x
j
+
r
)
d, and the RBF kernel K
(
x
i
,
x
j
)
=
exp
⁡
(
-
γ
∥
x
i
-
x
j
∥
2
).


### 3.2. The Proposed Hybrid Sampling Approach

This paper proposes a hybrid sampling approach based on support vector machine to address the imbalanced data classification problem. The proposed approach first uses SVM method to generate a classification hyperplane and applies an undersampling technique to reduce negative samples which include less classification information. And then, we divide the training dataset into several subsets, in which we synthesize new positive samples using an oversampling technique. Once the majority class has been undersampled and the minority class has been oversampled, a new balanced training dataset is created and is used to train an SVM classifier. The proposed approach effectively balances the initial imbalanced dataset and improves classification precision on the basis of maximizing data balance.The framework of our proposed approach is presented as follows. Given the training datasetT
=
{
(
x
1
,
y
1
)
,
(
x
2
,
y
2
)
,
…
,
(
x
l
,
y
l
)
}, where y
i
∈
{
-
1
,
+
1
} represents the class labels of the negative and positive samples, respectively, k is the size of the training dataset. Suppose that an imbalanced dataset contains n samples from the majority class and m samples from the minority class, where n
≫
m and n
+
m
=
l. The imbalance ratio IR is n
/
m.In undersampling phase, the proposed approach first trains an SVM classifier for training datasetT and obtains a classification hyperplane w
·
x
+
b
=
0 and then deletes some negative samples with less information by undersampling. Our approach is based on the distance between sample z and the hyperplane as follows:
(5)
d
=
∥
w
·
z
+
b
∥
.We proportionately delete some negative samples far away from the hyperplane according the calculated distances. After undersampling, the imbalance ratio is reduced; for instance, the imbalance ratio is the half of original IR. We label the training dataset after undersampling asT
0 including n
0 negative samples and m
0 positive samples.In oversampling phase, the proposed approach first randomly divides the training datasetT
0 into k disjoint subsets T
1
,
T
2
,
…
,
T
k. Each T
i contains n
ipositive samples and m
i negative samples. We randomly select a subset, for instance, T
1, and oversample the positive samples using SMOTE method for subset T
1. Then, a new training dataset G
1 is generated by merging the new synthetic samples into T
1. We train an initial SVM classifier F
1 for dataset G
1.For theith one of the restk−1 subsets, we select p
i negative samples near the hyperplane of classifier F
i
-
1 according to (5) and generate synthetic instances using SMOTE method. Similarly, a new training dataset G
i is generated by merging all n
i positive samples and the new synthetic samples into G
i
-
1. We train an SVM classifier F
i for dataset G
i
-
1.In the oversampling for the positive class, the smaller the size of positive samples within a subset is, the more the instances are oversampled.Based on the description above, the proposed hybrid sampling SVM approach is described in Algorithm1.Algorithm 1:The hybrid sampling SVM method.
Input:Imbalanced training data set T
0
Output:An SVM classifier F
k
Step  1. Train an SVM classifier for training dataset T
0 and delete some negative samples using (5).
Step  2. Divide randomly T into k disjoint equivalent subsets T
1
,
T
2
,
…
,
T
k.
Step  3. Select subset T
1 and over-sample the positive samples using SMOTE method; generate a
new training data set G
1 by merging the new synthetic samples into T
1; train an initial SVM
classifier F
1 for data set G
1.
Step  4. For each subset T
i in the rest k
-
1 subsets do
Step  2.1. Compute the distances between negative samples and the hyperplane of classifier F
i
-
1
according to (5).
Step  2.2. Select p
i negative samples with the smallest distances; generate synthetic instances
using SMOTE method.
Step  2.3. Merge all n
i positive samples and the new synthetic samples into G
i
-
1, and obtain data
set G
i.
Step  2.4. Train an SVM classifier F
i for dataset G
i.
Step  5. Classify data set G
k using SVM method, and obtain a classifier F
k.


## 3.1. Review of Support Vector Machine

SVM was first introduced to solve the pattern classification and regression problems by Vapnik and his colleagues [4, 35]. In recent years, SVM has drawn considerable attentions due to its high generalization ability of a wide range of applications and better performance than other traditional learning machines. The goal of the SVM learning algorithm is to find a separating hyperplane that separates these data points into two classes.Consider a binary classification problem consisting ofl training samples {
(
x
1
,
y
1
)
,
(
x
2
,
y
2
)
,
…
,
(
x
l
,
y
l
)
}, where x
i
=
(
x
i
1
,
x
i
2
,
…
,
x
i
d
)
T represents a d-dimensional data point and y
i
∈
{
+
1
,
-
1
} denotes its class label. The decision boundary of a linear classifier can be written in the following form:
(1)
w
·
x
+
b
=
0
,
wherew and b are parameters of the model. To have more flexible ways to deal with nonlinear separable data, we can first transform the training samples into a high-dimensional feature space using a nonlinear mapping Φ. Therefore, (1) can be rewritten as w
·
Φ
(
x
)
+
b
=
0.The support vector technique requires the solution of the following optimization problem:(2)
min
⁡
w
∥
w
∥
2
2
subject to y
i
(
w
·
Φ
(
x
i
)
+
b
)
≥
1, for i
=
1
,
…
,
l.This optimization problem can be solved by constructing a Lagrangian representation and transforming it into the following dual problem:(3)
L
D
=
∑
i
=
1
l
α
i
-
1
2
∑
i
=
1
l
∑
j
=
1
l
α
i
α
j
y
i
y
j
Φ
(
x
i
)
·
Φ
(
x
j
)
.Once allα
i are found using quadratic programming techniques, we can use the KKT conditions to express the optimal primal variablew in terms of the optimal dual variables, according to w
=
∑
i
=
1
l
α
i
y
i
Φ
(
x
i
). Note thatw depends only on the x
i for which α
i
≠
0, which are called thesupport vectors (SVs).When the optimal pair(
w
0
,
b
0
) is determined, the SVM decision function is then given by
(4)
f
(
x
)
=
sign
⁡
(
∑
i
∈
SVs
α
i
y
i
Φ
(
x
i
)
·
Φ
(
x
)
+
b
)
.Iff
(
x
)
=
1, then the test samplex is classified as a positive class; otherwise, it is classified as a negative class.Furthermore, the dot productΦ
(
x
i
)
·
Φ
(
x
j
) in the transformed space can be expressed as the kernel function K
(
x
i
,
x
j
)
=
Φ
(
x
i
)
·
Φ
(
x
j
). Thus, the kernel is the key that determines the performance of the SVM. Several typical kernel functions are the lineal kernel K
(
x
i
,
x
j
)
=
x
i
·
x
j, the polynomial kernel K
(
x
i
,
x
j
)
=
(
a
x
i
T
x
j
+
r
)
d, and the RBF kernel K
(
x
i
,
x
j
)
=
exp
⁡
(
-
γ
∥
x
i
-
x
j
∥
2
).


## 3.2. The Proposed Hybrid Sampling Approach

This paper proposes a hybrid sampling approach based on support vector machine to address the imbalanced data classification problem. The proposed approach first uses SVM method to generate a classification hyperplane and applies an undersampling technique to reduce negative samples which include less classification information. And then, we divide the training dataset into several subsets, in which we synthesize new positive samples using an oversampling technique. Once the majority class has been undersampled and the minority class has been oversampled, a new balanced training dataset is created and is used to train an SVM classifier. The proposed approach effectively balances the initial imbalanced dataset and improves classification precision on the basis of maximizing data balance.The framework of our proposed approach is presented as follows. Given the training datasetT
=
{
(
x
1
,
y
1
)
,
(
x
2
,
y
2
)
,
…
,
(
x
l
,
y
l
)
}, where y
i
∈
{
-
1
,
+
1
} represents the class labels of the negative and positive samples, respectively, k is the size of the training dataset. Suppose that an imbalanced dataset contains n samples from the majority class and m samples from the minority class, where n
≫
m and n
+
m
=
l. The imbalance ratio IR is n
/
m.In undersampling phase, the proposed approach first trains an SVM classifier for training datasetT and obtains a classification hyperplane w
·
x
+
b
=
0 and then deletes some negative samples with less information by undersampling. Our approach is based on the distance between sample z and the hyperplane as follows:
(5)
d
=
∥
w
·
z
+
b
∥
.We proportionately delete some negative samples far away from the hyperplane according the calculated distances. After undersampling, the imbalance ratio is reduced; for instance, the imbalance ratio is the half of original IR. We label the training dataset after undersampling asT
0 including n
0 negative samples and m
0 positive samples.In oversampling phase, the proposed approach first randomly divides the training datasetT
0 into k disjoint subsets T
1
,
T
2
,
…
,
T
k. Each T
i contains n
ipositive samples and m
i negative samples. We randomly select a subset, for instance, T
1, and oversample the positive samples using SMOTE method for subset T
1. Then, a new training dataset G
1 is generated by merging the new synthetic samples into T
1. We train an initial SVM classifier F
1 for dataset G
1.For theith one of the restk−1 subsets, we select p
i negative samples near the hyperplane of classifier F
i
-
1 according to (5) and generate synthetic instances using SMOTE method. Similarly, a new training dataset G
i is generated by merging all n
i positive samples and the new synthetic samples into G
i
-
1. We train an SVM classifier F
i for dataset G
i
-
1.In the oversampling for the positive class, the smaller the size of positive samples within a subset is, the more the instances are oversampled.Based on the description above, the proposed hybrid sampling SVM approach is described in Algorithm1.Algorithm 1:The hybrid sampling SVM method.
Input:Imbalanced training data set T
0
Output:An SVM classifier F
k
Step  1. Train an SVM classifier for training dataset T
0 and delete some negative samples using (5).
Step  2. Divide randomly T into k disjoint equivalent subsets T
1
,
T
2
,
…
,
T
k.
Step  3. Select subset T
1 and over-sample the positive samples using SMOTE method; generate a
new training data set G
1 by merging the new synthetic samples into T
1; train an initial SVM
classifier F
1 for data set G
1.
Step  4. For each subset T
i in the rest k
-
1 subsets do
Step  2.1. Compute the distances between negative samples and the hyperplane of classifier F
i
-
1
according to (5).
Step  2.2. Select p
i negative samples with the smallest distances; generate synthetic instances
using SMOTE method.
Step  2.3. Merge all n
i positive samples and the new synthetic samples into G
i
-
1, and obtain data
set G
i.
Step  2.4. Train an SVM classifier F
i for dataset G
i.
Step  5. Classify data set G
k using SVM method, and obtain a classifier F
k.


## 4. Experiment and Analysis

In this section, we evaluate the performances for our proposed hybrid sampling approach on real datasets. In the following, we first describe several evaluation measures for class imbalanced problem and then compareF-measure and G-mean of our method with the other methods.


### 4.1. Evaluation Measures

In general, the performance of a classifier is evaluated based on its overall accuracy on an independent test dataset. However, the overall classification accuracy on an imbalanced dataset is mainly dominated by the majority class. Therefore, accuracy is not an appropriate evaluation measure for imbalanced data. Researchers use different metrics to evaluate the performance of imbalanced data classification methods. These metrics include the accuracy rate,F-measure, geometric mean (G-mean), and AUC [36].The result of classification can be categorized into four cases as follows. TP (true positive) is the number of actual positives that were correctly classified as positives. FP (false positive) is the number of actual negatives that were incorrectly classified as positives. TN (true negative) is the number of actual negatives that were correctly classified as negatives. FN (false negative) is the number of actual positives that were incorrectly classified as negatives.Accuracy is the most used evaluation metric for assessing the classification performance and guiding the classifier modeling. The overall accuracy is defined as(6)
Accuracy
=
TP
+
TN
TP
+
FP
+
TN
+
FN
.G-mean is the geometric mean of accuracies measured separately on each class, which is commonly utilized when performance of both classes is concerned and expected to be high simultaneously. G-mean is defined as
(7)
G
-mean
=
S
sens
×
S
spec
,
where S
sens and S
spec denote sensitivity and specificity, respectively. Sensitivity, also called the TP rate (TPrate) or the recall (Recall), shows the performance of the positive class as follows:
(8)
S
sens
=
T
P
r
a
t
e
=
R
e
c
a
l
l
=
TP
TP
+
FN
.
Specificity, also called the TN rate (TNrate), shows the performance of the negative class as follows:
(9)
S
spec
=
T
N
r
a
t
e
=
TN
TN
+
FP
.F-measure is often used in the fields of information retrieval and machine learning for measuring search, document classification, and query classification performance. F-measure considers both thePrecision and theRecall to compute the score. Generally, for a classifier, if thePrecision is high, then theRecall will be low; that is, the two criteria are trade-off.Precision andRecallare combined to form a criterion F-measure, which is shown in expression (10). Consider
(10)
F
-measure
=
(
1
+
β
)
2
×
P
r
e
c
i
s
i
o
n
×
R
e
c
a
l
l
P
r
e
c
i
s
i
o
n
+
R
e
c
a
l
l
,
where β is set to 1 in this paper. ThePrecision for minority class is the correct-classified percentage of samples which are predicted as minority class by the classifier. It is defined as follows:
(11)
P
r
e
c
i
s
i
o
n
=
TP
TP
+
FP
.AUC is the area under the receiver operating characteristic (ROC) curve. ROC consists of plotting the true positive rate as a function of the false positive rate along all possible threshold values for the classifier. An ROC curve depicts relative trade-offs between true positives and false positives across a range of thresholds of a classifier. However, it is difficult to compare several classification models through curves. Therefore, it is common for results to be reported with respect to AUC. AUC can be interpreted as the expected proportion of positive samples ranked before a uniformly drawn random negative sample [36].In the following, we use the two criteriaF-measure and G-mean discussed above to evaluate the performance of our approaches by comparing our methods with the other methods.


### 4.2. Experimental Results and Analysis

In this subsection, we will compare our proposed approach to address the class imbalance problem with several techniques. The experiments use 6 datasets which have different degrees of imbalance from KEEL [37], includingCmc2,Glass7,Abalone7,Vowel,Yeast, andLetter4. Information about these datasets is summarized in Table 1. They are very varied in their size of classes, size of attributes, size of samples, and imbalance ratio. When more than two classes exist in the dataset, the target class is considered to be positive and all the other classes are considered to be negative. For each dataset, the size of samples (number of samples), the size of attributes (number of attributes), the size of samples of each class (number of positives and number of negatives), and imbalance ratio are listed. We calculate class imbalance ratio of the size of the majority class to the size of the minority class.Table 1
Summary of data sets.
Data set
#Samples
#Attributes
#Positves
#Negatives
Imbalance ratio
Cmc2
1473
10
333
1140
3.4
Glass7
214
9
29
185
6.4
Abalone7
4177
8
391
3786
9.7
Vowel
990
13
90
900
10.0
Yeast
1332
8
84
1248
14.9
Letter4
20000
16
805
19195
23.8We compared the performance of 4 methods, including undersampling (Under), SMOTE [11], EasyEnsemble [7], and our proposed method. For undersampling, we use a random sampling method. SMOTE is used with five neighbours. EasyEnsemble selects C4.5 decision tree as the baseline classifier. In all our experiments, we perform a 10-fold cross validation.In our experiments,F-measure and G-mean are used as metrics. Table 2 shows the average F-measure obtained by 4 methods. The results indicate that our proposed approach has higher F-measure than that of other compared methods onCmc2,Abalone7,Vowel,Yeast, andLetter4 datasets. EasyEnsemble outperforms other compared methods onGlass7 dataset. The results indicate that our proposed approach can further improve the F
-measure metric of imbalanced learning.Table 2
F-measure of the compared methods.
F-measure
Under
SMOTE
EasyEnsemble
Our approach
Cmc2
0.4308
0.4631
0.5267
0.5491
Glass7
0.8272
0.8539
0.8965
0.8867
Abalone7
0.2976
0.4250
0.5913
0.5946
Vowel
0.7632
0.7769
0.8431
0.8752
Yeast
0.6342
0.6281
0.7038
0.7234
Letter4
0.5308
0.5752
0.6076
0.6614Table3 lists the results of the average G
-mean of the compared methods. The results show that our proposed approach has higher G
-mean than other compared methods on most of datasets, while EasyEnsemble is slightly higher G
-mean than our proposed approach onGlass7 dataset. This is consistent with our analysis in F
-measure.Table 3
G-mean of the compared methods.
G-mean
Under
SMOTE
EasyEnsemble
Our approach
Cmc2
0.5325
0.5461
0.5734
0.5823
Glass7
0.8432
0.8865
0.9237
0.9125
Abalone7
0.3524
0.4672
0.6613
0.6653
Vowel
0.8125
0.8333
0.8769
0.9013
Yeast
0.6631
0.6547
0.7532
0.7845
Letter4
0.5543
0.5945
0.6217
0.6976


## 4.1. Evaluation Measures

In general, the performance of a classifier is evaluated based on its overall accuracy on an independent test dataset. However, the overall classification accuracy on an imbalanced dataset is mainly dominated by the majority class. Therefore, accuracy is not an appropriate evaluation measure for imbalanced data. Researchers use different metrics to evaluate the performance of imbalanced data classification methods. These metrics include the accuracy rate,F-measure, geometric mean (G-mean), and AUC [36].The result of classification can be categorized into four cases as follows. TP (true positive) is the number of actual positives that were correctly classified as positives. FP (false positive) is the number of actual negatives that were incorrectly classified as positives. TN (true negative) is the number of actual negatives that were correctly classified as negatives. FN (false negative) is the number of actual positives that were incorrectly classified as negatives.Accuracy is the most used evaluation metric for assessing the classification performance and guiding the classifier modeling. The overall accuracy is defined as(6)
Accuracy
=
TP
+
TN
TP
+
FP
+
TN
+
FN
.G-mean is the geometric mean of accuracies measured separately on each class, which is commonly utilized when performance of both classes is concerned and expected to be high simultaneously. G-mean is defined as
(7)
G
-mean
=
S
sens
×
S
spec
,
where S
sens and S
spec denote sensitivity and specificity, respectively. Sensitivity, also called the TP rate (TPrate) or the recall (Recall), shows the performance of the positive class as follows:
(8)
S
sens
=
T
P
r
a
t
e
=
R
e
c
a
l
l
=
TP
TP
+
FN
.
Specificity, also called the TN rate (TNrate), shows the performance of the negative class as follows:
(9)
S
spec
=
T
N
r
a
t
e
=
TN
TN
+
FP
.F-measure is often used in the fields of information retrieval and machine learning for measuring search, document classification, and query classification performance. F-measure considers both thePrecision and theRecall to compute the score. Generally, for a classifier, if thePrecision is high, then theRecall will be low; that is, the two criteria are trade-off.Precision andRecallare combined to form a criterion F-measure, which is shown in expression (10). Consider
(10)
F
-measure
=
(
1
+
β
)
2
×
P
r
e
c
i
s
i
o
n
×
R
e
c
a
l
l
P
r
e
c
i
s
i
o
n
+
R
e
c
a
l
l
,
where β is set to 1 in this paper. ThePrecision for minority class is the correct-classified percentage of samples which are predicted as minority class by the classifier. It is defined as follows:
(11)
P
r
e
c
i
s
i
o
n
=
TP
TP
+
FP
.AUC is the area under the receiver operating characteristic (ROC) curve. ROC consists of plotting the true positive rate as a function of the false positive rate along all possible threshold values for the classifier. An ROC curve depicts relative trade-offs between true positives and false positives across a range of thresholds of a classifier. However, it is difficult to compare several classification models through curves. Therefore, it is common for results to be reported with respect to AUC. AUC can be interpreted as the expected proportion of positive samples ranked before a uniformly drawn random negative sample [36].In the following, we use the two criteriaF-measure and G-mean discussed above to evaluate the performance of our approaches by comparing our methods with the other methods.


## 4.2. Experimental Results and Analysis

In this subsection, we will compare our proposed approach to address the class imbalance problem with several techniques. The experiments use 6 datasets which have different degrees of imbalance from KEEL [37], includingCmc2,Glass7,Abalone7,Vowel,Yeast, andLetter4. Information about these datasets is summarized in Table 1. They are very varied in their size of classes, size of attributes, size of samples, and imbalance ratio. When more than two classes exist in the dataset, the target class is considered to be positive and all the other classes are considered to be negative. For each dataset, the size of samples (number of samples), the size of attributes (number of attributes), the size of samples of each class (number of positives and number of negatives), and imbalance ratio are listed. We calculate class imbalance ratio of the size of the majority class to the size of the minority class.Table 1
Summary of data sets.
Data set
#Samples
#Attributes
#Positves
#Negatives
Imbalance ratio
Cmc2
1473
10
333
1140
3.4
Glass7
214
9
29
185
6.4
Abalone7
4177
8
391
3786
9.7
Vowel
990
13
90
900
10.0
Yeast
1332
8
84
1248
14.9
Letter4
20000
16
805
19195
23.8We compared the performance of 4 methods, including undersampling (Under), SMOTE [11], EasyEnsemble [7], and our proposed method. For undersampling, we use a random sampling method. SMOTE is used with five neighbours. EasyEnsemble selects C4.5 decision tree as the baseline classifier. In all our experiments, we perform a 10-fold cross validation.In our experiments,F-measure and G-mean are used as metrics. Table 2 shows the average F-measure obtained by 4 methods. The results indicate that our proposed approach has higher F-measure than that of other compared methods onCmc2,Abalone7,Vowel,Yeast, andLetter4 datasets. EasyEnsemble outperforms other compared methods onGlass7 dataset. The results indicate that our proposed approach can further improve the F
-measure metric of imbalanced learning.Table 2
F-measure of the compared methods.
F-measure
Under
SMOTE
EasyEnsemble
Our approach
Cmc2
0.4308
0.4631
0.5267
0.5491
Glass7
0.8272
0.8539
0.8965
0.8867
Abalone7
0.2976
0.4250
0.5913
0.5946
Vowel
0.7632
0.7769
0.8431
0.8752
Yeast
0.6342
0.6281
0.7038
0.7234
Letter4
0.5308
0.5752
0.6076
0.6614Table3 lists the results of the average G
-mean of the compared methods. The results show that our proposed approach has higher G
-mean than other compared methods on most of datasets, while EasyEnsemble is slightly higher G
-mean than our proposed approach onGlass7 dataset. This is consistent with our analysis in F
-measure.Table 3
G-mean of the compared methods.
G-mean
Under
SMOTE
EasyEnsemble
Our approach
Cmc2
0.5325
0.5461
0.5734
0.5823
Glass7
0.8432
0.8865
0.9237
0.9125
Abalone7
0.3524
0.4672
0.6613
0.6653
Vowel
0.8125
0.8333
0.8769
0.9013
Yeast
0.6631
0.6547
0.7532
0.7845
Letter4
0.5543
0.5945
0.6217
0.6976


## 5. Conclusions

For the class imbalance problem, resampling technique is an effective approach to resolve it. This paper proposes a hybrid sampling SVM approach, which combines undersampling and oversampling techniques. The proposed approach generates a relatively balanced dataset without significant loss of information and without the addition of a great number of synthetic samples. Thus, SVM classifier employed by our proposed approach can effectively improve the classification accuracy of original imbalanced dataset. Experimental results show that the proposed approach outperforms existing oversampling and undersampling techniques.



---

*Source: 972786-2014-06-12.xml*