liveBook · Manning

Chapter 3: Ligand-based Screening: Machine Learning

What you will learn in chapter 3 of Build AI Drug Discovery Pipelines

Introduces the stages and vocabulary of a machine-learning workflow for cardiotoxicity prediction and explains why the workflow is iterative.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces the stages and vocabulary of a machine-learning workflow for cardiotoxicity prediction and explains why the workflow is iterative.

Key terms: problem definition, data acquisition, data exploration, pre-processing, featurization, model training, features, training instance, labels, iterative

3.1 Problem Understanding

This section frames hERG blocker screening as a project-defined filtering task and explains the predictions, risks, and benchmarks that matter for judging a model.

Key terms: virtual screening pipeline, project requirements, Malaria Box compounds, antitarget, off-target, hERG potassium channel, hERG non-blocker, hERG blocker, low-confidence compounds, benchmark

3.1.1 Your Machine Learning Task

This section explains when machine learning may be useful for screening compounds and defines hERG blocking prediction as a supervised binary classification task.

Key terms: capacity, training data, generalize, unseen molecules, positive class, negative class, binary classification, multiclass classification, supervised learning, labeled dataset

3.2 Data Acquisition, Exploration, & Curation

This section identifies sources of molecular property data and explains when a dataset aggregator helps readers find relevant datasets.

Key terms: PubChem, ChEMBL, benchmark datasets, dataset aggregator, Therapeutics Data Commons

3.2.1 Loading and Exploring the hERG Blockers Dataset

This section introduces the hERG blockers dataset, identifies the target and split columns, and uses exploratory analysis to explain why data quality matters before modeling.

Key terms: SMILES, pIC50, Class, Set I, Set II, IC50, hERG blockers, feature, class variable, curation

3.2.2 Validating & Standardizing SMILES

This section uses visual inspection to motivate standardizing molecular structures, then describes the standardization operations and their limits.

Key terms: hERG blockers, structural patterns, outliers, structural alerts, molecular validation, molecular standardization, reproducibility, rdMolStandardize, largest parent fragment, neutralize

3.2.3 Feature Generation & Exploration

The section represents standardized hERG molecules with Morgan fingerprints and explores how frequently their bits are set before modeling.

Key terms: Morgan fingerprints, fingerprint bits, 2048-dimensional representations, sparse, outlier bits, bits set per molecule, fingerprint length, nBits, Morgan radius, overfitting

3.3 Application of Linear Models

This section introduces modeling as learning a mapping from molecular features to a property to predict.

Key terms: training, features, property

3.3.1 Learning from Data

This section explains how labeled hERG data supports a supervised model, what the model learns during training, and how it is used for inference.

Key terms: input-output examples, molecular descriptors, structural fingerprints, hERG blocking, target function, ground truth, training dataset, generalizing, weights, parameters

3.3.2 Training our Linear Model

This section trains a linear classifier to predict hERG channel blocking from molecular fingerprints, then cautions against treating high training-set accuracy as a solved prediction problem.

Key terms: fingerprints, hERG channel, linear classifier, training set, test set, SGDClassifier, accuracy, binary classifier

3.3.3 Evaluating our Model

This section evaluates a hERG blocker classifier with cross-validation and classification metrics, revealing that its strong training performance does not carry over to unseen data.

Key terms: test set, generalization error, validation set, k-fold cross validation, folds, validation fold, near-identical analogs, training and validation folds, splitting strategy, accuracy

3.4 Improving our Model

This section argues for checking the data for sources of poor performance before trying model-centric improvements.

Key terms: class balance, duplicate or near-duplicate compounds, chemical scaffolds, cross-validation fold, false positives, false negatives

3.4.1 Regularization

This section uses unusually large model coefficients to motivate regularization, then explains how common penalties constrain weights.

Key terms: coefficient weights, overfitting, generalization error, multicollinearity, fingerprint bits, features, regularization, cost function, L1 regularization, L2 regularization

3.4.2 Non-linear Transformation

3.4.3 Hyperparameter Tuning

This section shows how to tune a molecular classification pipeline with grid and randomized search, while keeping evaluation leakage-free and interpreting the results.

Key terms: hyperparameter tuning, underfits, overfits, Morgan fingerprint, regularization, pipeline, transformer, estimator, cross-validation, data leakage

3.4.4 Evaluating the Best Model

The section evaluates the selected hERG-blocker model on held-out data, interprets its fingerprint weights, compares its performance with benchmarks, and limits claims to an appropriate applicability domain.

Key terms: test set, cross-validated F1-score, grid search, experimental variability, polynomial features, bit vector, molecular fingerprints, sparsity, regularization, coefficients

3.4.5 Saving and Applying our Model

This subsection explains how to save and reload a trained model for predictions on additional compounds.

Key terms: Scikit-Learn, joblib, custom classes or functions, Malaria Box compounds

3.5 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 2: Ligand-based Screening: Filtering & Similarity Searching Chapter 4: Solubility Deep Dive with Linear Models →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.