|
Algorithm 1: Data balancing through SMOTE |
-
1:
Initialization
-
2:
Inputs: Minority data M = X, Where i = 1, 2, 3, …, D
-
3:
Outputs: Synthetic Data S
-
4:
Number of minority samples
-
5:
Percentage of SMOTE
-
6:
Number of nearest neighbors
-
7:
for n = 1 to D do
-
8:
Find the K nearest neighbors of
-
9:
Check
-
10:
Whiledo
-
11:
Select a random sample m in minority class
-
12:
Find neighbor of m
-
13:
Pick a random number
-
14:
-
15:
While Append to S
-
16:
Check
-
17:
end while
-
18:
end for
-
19:
End
|