liveBook · Manning

Undersampling

As explained in Build AI Drug Discovery Pipelines

Random undersampling is a sampling technique that randomly removes instances from the majority class to reduce class imbalance.

Random undersampling reduces class imbalance by randomly removing majority-class instances until the classes are more balanced. In drug-discovery classification, this can prevent abundant noninhibitor molecules from steering a model away from identifying inhibitors. section 5.2.2

Use undersampling with these trade-offs in mind:

  • It may discard informative majority-class molecules, and reducing a small dataset further can harm learning. section 5.2.2
  • Evaluate imbalanced classifiers with precision and recall rather than accuracy alone. section 5.2.2
  • Compare it with random oversampling or SMOTE, which duplicate or synthetically generate minority-class examples instead. section 5.2.2

CYP450 inhibitor classification

Separate inhibitor and noninhibitor rows, retain every inhibitor, randomly sample an equal number of noninhibitors, and fit a decision tree to the resulting fingerprints.

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Defines the procedure, demonstrates implementation, and emphasizes information loss without developing advanced undersampling algorithms.
Examples
Uses CYP450 inhibitor data, molecular fingerprints, a decision tree, and a figure comparing downsampled and upsampled class composition.
What you can do after
Apply via pandas and scikit-learn by sampling majority rows and fitting a classifier on the balanced training data.
How it connects
Connects undersampling to class imbalance, precision, recall, random oversampling, SMOTE, calibration, and threshold tuning.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI Drug Discovery Pipelines. The section links point to the parts of the book it draws on.