Skip to content

Commit ffd0ea8

Browse files
committed
More style changes
1 parent 0ae76ff commit ffd0ea8

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

unbalanced_dataset/ensemble_sampling.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def resample(self):
6464

6565
return subsets_x, subsets_y
6666

67+
6768
class BalanceCascade(UnbalancedDataset):
6869
"""
6970
Object to perform classification on balanced ensembled selected from
@@ -247,4 +248,4 @@ def resample(self):
247248
print('Not enough samples to continue creating subsets')
248249

249250
# Return the different subsets
250-
return subsets_x, subsets_y
251+
return subsets_x, subsets_y

unbalanced_dataset/over_sampling.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from __future__ import print_function
22
from __future__ import division
3-
43
import numpy as np
54
from numpy.random import seed, randint
65
from numpy import concatenate, asarray
76
from random import betavariate
87
from collections import Counter
98
from .unbalanced_dataset import UnbalancedDataset
109

10+
1111
class OverSampler(UnbalancedDataset):
1212
"""
1313
Object to over-sample the minority class(es) by picking samples at random
@@ -387,7 +387,7 @@ def resample(self):
387387
# Turn into array#
388388
danger_bool = asarray(danger_bool)
389389

390-
#Something ...#
390+
# Something ...#
391391
safety_bool = np.logical_not(danger_bool)
392392

393393
if self.verbose:
@@ -449,4 +449,4 @@ def resample(self):
449449
ret_x = concatenate((self.x, sx1, sx2), axis=0)
450450
ret_y = concatenate((self.y, sy1, sy2), axis=0)
451451

452-
return ret_x, ret_y
452+
return ret_x, ret_y

unbalanced_dataset/pipeline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from collections import Counter
66
from .unbalanced_dataset import UnbalancedDataset
77

8+
89
class SMOTETomek(UnbalancedDataset):
910
"""
1011
An implementation of SMOTE + Tomek.
@@ -80,6 +81,7 @@ def resample(self):
8081
# Return data set without majority Tomek links.
8182
return ret_x[logical_not(links)], ret_y[logical_not(links)]
8283

84+
8385
class SMOTEENN(UnbalancedDataset):
8486
"""
8587
An implementation of SMOTE + ENN.

0 commit comments

Comments
 (0)