DOI: 10.1021/acsenvironau.6c00036 ISSN: 2694-2518

How to Build Machine-Learning Models for Molecular Science: A Step-by-Step, Annotated Tutorial

Kai Zhang, Yushu Cheng, Haiping Ai, Huichun Zhang

Abstract

Machine learning (ML) holds immense promise for predictive modeling but is often misapplied without a systematic understanding of the full model development pipeline. This tutorial provides a comprehensive, end-to-end workflow─from raw data to deployed models─explicitly designed for environmental chemists with limited prior experience in ML modeling while also providing practical guidance for other users seeking to strengthen their modeling workflows. Using a public high-performance liquid chromatography small molecule retention time (SMRT) data set containing over 80,000 small molecules, this tutorial demonstrates critical stages: data cleaning via chemical similarity and scaffold analysis, application-oriented data splitting, feature engineering with molecular fingerprints and graphs, model development using commonly used LightGBM and Graph Convolutional Network (GCN), and model interpretation with different methods. This work highlights how domain knowledge guides each step to avoid common pitfalls, such as overestimating model performance through inappropriate data splits. The work concludes with a robust deployment framework that ensures models are both accurate and accessible. All code is openly available, providing an example implementation for users to reference when developing ML models across diverse applications.

More from our Archive