Member-only story
What is Class Imbalance and how to fix class imbalance in Datasets
Demystifying Class Imbalance in Datasets — with R
5 min readJul 28, 2019

Class Imbalance is when the prediction/Target classes are largely skewed, or few of the classes have distinctly lower sample size than the dominant prediction classes.
Data Understanding
Here we are using Kaggle data to explain class imbalance and explain how to handle it. Here is the link to data , we are using Credit card fraud detection.
Let’s have a look to our data.
data <- read_csv("../input/creditcard.csv") head(data)

Let’s have a look to our target column
prop.table(table(data$Class))

