41134f440773c308f5224e70cd060286be6d5dd4,UnbalancedDataset.py,SMOTETomek,resample,#SMOTETomek#,1198
Before Change
from sklearn.neighbors import NearestNeighbors
// Find the nearest neighbour of every point
print("Finding nearest neighbour...", end="")
nn = NearestNeighbors(n_neighbors=2)
nn.fit(ret_x)
nns = nn.kneighbors(ret_x, return_distance=False)[:, 1]
print("done!")
After Change
// Send the information to is_tomek function to get boolean vector back
links = self.is_tomek(ret_y, nns, self.minc, self.verbose)
if self.verbose==True:
print("Over-sampling performed: " + str(Counter(ret_y[logical_not(links)])))
// Return data set without majority Tomek links.
return ret_x[logical_not(links)], ret_y[logical_not(links)]
class SMOTEENN(UnbalancedDataset):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances Project Name: scikit-learn-contrib/imbalanced-learn
Commit Name: 41134f440773c308f5224e70cd060286be6d5dd4
Time: 2015-05-27
Author: glemaitre@visor.udg.edu
File Name: UnbalancedDataset.py
Class Name: SMOTETomek
Method Name: resample
Project Name: scikit-learn-contrib/imbalanced-learn
Commit Name: 41134f440773c308f5224e70cd060286be6d5dd4
Time: 2015-05-27
Author: glemaitre@visor.udg.edu
File Name: UnbalancedDataset.py
Class Name: OneSidedSelection
Method Name: resample
Project Name: scikit-learn-contrib/imbalanced-learn
Commit Name: 41134f440773c308f5224e70cd060286be6d5dd4
Time: 2015-05-27
Author: glemaitre@visor.udg.edu
File Name: UnbalancedDataset.py
Class Name: TomekLinks
Method Name: resample