Project - Credit Card Fraud Detection using Machine Learning

10 / 25

Visualizing the class Imbalance

Let us visualize the class-imbalance using Seaborn countplot.


  • sns.countplot shows the counts of observations in each categorical bin using bars.
  • Mention the colors of the bars to be displayed for each class in the count plot.

    colors = ['blue','red']
  • Use sns.countplot and pass 'Class', data=data and palette=colors as input arguments.

    << your code comes here >>('Class', data=data, palette=colors)

    We observe that the classes are highly imbalanced with most of the transactions are non-fraud.

Get Hint See Answer

Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...