Product

Sunday, 11 February 2024

Standard Machine Learning Datasets for Imbalanced Classification

 


An imbalanced classification problem is a problem that involves predicting a class label where the distribution of class labels in the training dataset is skewed.

Many real-world classification problems have an imbalanced class distribution, therefore it is important for machine learning practitioners to get familiar with working with these types of problems.

In this tutorial, you will discover a suite of standard machine learning datasets for imbalanced classification.

After completing this tutorial, you will know:

  • Standard machine learning datasets with an imbalance of two classes.
  • Standard datasets for multiclass classification with a skewed class distribution.
  • Popular imbalanced classification datasets used for machine learning competitions.

Kick-start your project with my new book Imbalanced Classification with Python, including step-by-step tutorials and the Python source code files for all examples.

Let’s get started.

  • Updated Jan/2021: Updated links for API documentation.
Standard Machine Learning Datasets for Imbalanced Classification

Standard Machine Learning Datasets for Imbalanced Classification
Photo by Graeme Churchard, some rights reserved.

Tutorial Overview

This tutorial is divided into three parts; they are:

  1. Binary Classification Datasets
  2. Multiclass Classification Datasets
  3. Competition and Other Datasets

Binary Classification Datasets

Binary classification predictive modeling problems are those with two classes.

Typically, imbalanced binary classification problems describe a normal state (class 0) and an abnormal state (class 1), such as fraud, a diagnosis, or a fault.

In this section, we will take a closer look at three standard binary classification machine learning datasets with a class imbalance. These are datasets that are small enough to fit in memory and have been well studied, providing the basis of investigation in many research papers.

The names of these datasets are as follows:

  • Pima Indians Diabetes (Pima)
  • Haberman Breast Cancer (Haberman)
  • German Credit (German)

Each dataset will be loaded and the nature of the class imbalance will be summarized.

Pima Indians Diabetes (Pima)

Each record describes the medical details of a female, and the prediction is the onset of diabetes within the next five years.

Below provides a sample of the first five rows of the dataset.

The example below loads and summarizes the class breakdown of the dataset.

Running the example provides the following output.

Want to Get Started With Imbalance Classification?

Take my free 7-day email crash course now (with sample code).

Click to sign-up and also get a free PDF Ebook version of the course.

Haberman Breast Cancer (Haberman)

Each record describes the medical details of a patient and the prediction is whether the patient survived after five years or not.

Below provides a sample of the first five rows of the dataset.

The example below loads and summarizes the class breakdown of the dataset.

Running the example provides the following output.

German Credit (German)

Each record describes the financial details of a person and the prediction is whether the person is a good credit risk.

Below provides a sample of the first five rows of the dataset.

The example below loads and summarizes the class breakdown of the dataset.

Running the example provides the following output.

Multiclass Classification Datasets

Multiclass classification predictive modeling problems are those with more than two classes.

Typically, imbalanced multiclass classification problems describe multiple different events, some significantly more common than others.

In this section, we will take a closer look at three standard multiclass classification machine learning datasets with a class imbalance. These are datasets that are small enough to fit in memory and have been well studied, providing the basis of investigation in many research papers.

The names of these datasets are as follows:

  • Glass Identification (Glass)
  • E-coli (Ecoli)
  • Thyroid Gland (Thyroid)

Note: it is common in research papers to transform imbalanced multiclass classification problems into imbalanced binary classification problems by grouping all of the majority classes into one class and leaving the smallest minority class.

Each dataset will be loaded and the nature of the class imbalance will be summarized.

Glass Identification (Glass)

Each record describes the chemical content of glass and prediction involves the type of glass.

Below provides a sample of the first five rows of the dataset.

The first column represents a row identifier and can be removed.

The example below loads and summarizes the class breakdown of the dataset.

Running the example provides the following output.

E-coli (Ecoli)

Each record describes the result of different tests and prediction involves the protein localization site name.

Below provides a sample of the first five rows of the dataset.

The first column represents a row identifier or name and can be removed.

The example below loads and summarizes the class breakdown of the dataset.

Running the example provides the following output.

Thyroid Gland (Thyroid)

Each record describes the result of different tests on a thyroid and prediction involves the medical diagnosis of the thyroid.

Below provides a sample of the first five rows of the dataset.

The example below loads and summarizes the class breakdown of the dataset.

Running the example provides the following output.

Competition and Other Datasets

This section lists additional datasets used in research papers that are less used, larger, or datasets used as the basis of machine learning competitions.

The names of these datasets are as follows:

  • Credit Card Fraud (Credit)
  • Porto Seguro Auto Insurance Claim (Porto Seguro)

Each dataset will be loaded and the nature of the class imbalance will be summarized.

Credit Card Fraud (Credit)

Each record describes a credit card translation and it is classified as fraud.

This data is about 144 megabytes uncompressed or 66 megabytes compressed.

Download the dataset and unzip it into your current working directory.

Below provides a sample of the first five rows of the dataset.

The example below loads and summarizes the class breakdown of the dataset.

Running the example provides the following output.

Porto Seguro Auto Insurance Claim (Porto Seguro)

Each record describes people’s car insurance details and prediction involves whether or not the person will make an insurance claim.

This data is about 42 megabytes compressed.

Download the dataset and unzip it into your current working directory.

Below provides a sample of the first five rows of the dataset.

The example below loads and summarizes the class breakdown of the dataset.

Running the example provides the following output.

Further Reading

This section provides more resources on the topic if you are looking to go deeper.

Papers

Articles

Summary

In this tutorial, you discovered a suite of standard machine learning datasets for imbalanced classification.

Specifically, you learned:

  • Standard machine learning datasets with an imbalance of two classes.
  • Standard datasets for multiclass classification with a skewed class distribution.
  • Popular imbalanced classification datasets used for machine learning competitions.

Do you have any questions?
Ask your questions in the comments below and I will do my best to answer.

No comments:

Post a Comment

Connect broadband

AI:List AI views on when for a naive kin after prolonged life suppression coercive behaviour by family members after demise of father with trauma for kin ocd formed after forced to do rituals, family tribal values honor specific activities, utmost religious activities occult witchcraft enforced to do by elder sibling his wife and mother thrice with great celibacy turned the kundalini activated after deep celibacy penance shouting physical Mental financial Extortion by sibling with toxic behaviours and the wife mother and then mockery suppression asking about who’re your worth backbiting among relatives sector toon negligence of intelligence intuitive behaviour- all religious psychological traps when not work and lead to loss of consciousness of kin trance state recovered by governance with technocrats using AI - kin was asked by mother that he’s to go the male should not be seen in house he’s many absurd thought forcefully in brain mind and outsiders already feel awkward of this kin unresponsive behaviour due to TBI PTSD ocd cvt and tell at workplace social gathering he’s to go and asked for sector toon extortion and mockery in various sense due to un practical behaviour negligence of body building due to neglect ion if essential food nutrition and stubbed suppressed in every sense in religious psychological traps by family members AI humanoid using various neural networks and LLMs for kin and required steps.

  List AI views on when for a naive kin after prolonged life suppression coercive behaviour by family members after demise of father with tr...