Menu

Exploring Class Distribution

Exploring Class Distribution

One of the most important steps in fraud detection is understanding how transactions are distributed.

Code

credit_card_data['Class'].value_counts()

Explanation

This output shows the number of:

  • Genuine transactions (Class = 0)
  • Fraudulent transactions (Class = 1)

The results clearly demonstrate that fraudulent transactions represent only a very small percentage of the dataset.

Understanding this imbalance is essential before building the classification model.