December 2018
Intermediate to advanced
268 pages
8h 23m
English
In this method, you randomly undersample the majority class in a distribution to make it match the distribution of other minority classes you would like to predict. Your data can suffer from a probability of over predicting the under served classes. In the generative paradigm, undersampling can bias the model to over-represent minority classes.
We have a simple code example that we will go through in this section:
import matplotlib.pyplot as pltimport numpy as npfrom sklearn.datasets import make_classificationfrom sklearn.decomposition import PCAfrom imblearn.under_sampling import RandomUnderSampler
Read now
Unlock full access