-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Over sampling
fernando edited this page Aug 16, 2014
·
8 revisions
OverSampler is an object that over-samples the minority class at random with replacement.
Parameters:
- ratio : Controls the number of new samples to draw. The number of new samples is given by int(ratio * num_minority_samples)
- random_state : Seed for random numbers generation.
SMOTE is an object that generates synthetic samples by applying the SMOTE algorithm. New minority samples are generated along the lines that connecting minority samples to its nearest minority neighbours.
Parameters:
- k : Number of nearest neighbours to use when generating synthetic samples.
- ratio : Controls the number of synthetic samples to generate. The number of new samples is given by int(ratio * num_minority_samples)
- random_state : Seed for random numbers generation.
bSMOTE1 is an object that generates synthetic samples by applying the SMOTE algorithm, but only to samples that are near the border between different classes.
New minority samples are generated along the lines that connecting minority samples to its nearest minority neighbours.
Parameters:
- m : Number of nearest neighbours to use when deciding if a sample is in danger.
- k : Number of nearest neighbours to use when generating synthetic samples.
- ratio : Controls the number of synthetic samples to generate. The number of new samples is given by int(ratio * num_minority_samples)
- random_state : Seed for random numbers generation.