Architecture

mlchem separates chemistry-specific operations from the reusable machine learning workflow. A typical molecular-property workflow starts with molecular structures, calculates descriptors, prepares the resulting feature table, then selects features and evaluates models. These stages are independent and can be used separately.

For a runnable end-to-end example, start with the quickstart. The API reference links to the full documentation for each package.

Package responsibilities

chem.calculator API

Calculates molecular descriptors and fingerprints, including RDKit- and Mordred-based features. Common entry points include mlchem.chem.calculator.descriptors.get_rdkitDesc() and mlchem.chem.calculator.descriptors.get_fingerprint_df().

chem.manipulation API

Creates, converts, and modifies molecular structures and provides molecular pattern-recognition utilities. Start with mlchem.chem.manipulation.create_molecule().

chem.visualise API

Draws molecular structures, displays atom-level importance maps, and visualises datasets in chemical space.

ml.preprocessing API

Transforms feature tables through scaling, feature expansion, dimensionality reduction, and sampling utilities. See mlchem.ml.preprocessing.scaling.scale_df_standard(), mlchem.ml.preprocessing.feature_transformation.polynomial_expansion(), and mlchem.ml.preprocessing.undersampling.undersample().

ml.feature_selection API

Provides feature filters and wrapper-based selection methods, including mlchem.ml.feature_selection.wrappers.SequentialForwardSelection and mlchem.ml.feature_selection.wrappers.CombinatorialSelection.

ml.modelling API

Evaluates estimators, supports ensemble workflows, assesses applicability domains, and interprets model predictions. See mlchem.ml.modelling.model_evaluation.crossval(), mlchem.ml.modelling.model_evaluation.y_scrambling(), and mlchem.ml.modelling.model_evaluation.MajorityVote.evaluate_cv().

Shared utilities

The root-level helper.py module provides reusable data, logging, and visualisation utilities. mlchem.metrics contains scores used by feature selection and model evaluation. These shared modules support the package workflows without requiring users to follow a single prescribed pipeline.