Chemprop Prediction and Fingerprints
Use this sub-skill when an agent needs to run trained Chemprop model artifacts with chemprop predict or extract learned encodings with chemprop fingerprint. Keep prediction-time command construction, model path discovery, output naming, ensemble individual outputs, fingerprint layer choice, and inference artifact interpretation here.
When to Use
Use this sub-skill for:
- Building
chemprop predict commands for CSV inputs and .pt or .ckpt model artifacts.
- Building
chemprop fingerprint commands for learned model representations.
- Choosing legal prediction outputs (
.csv, .pkl) or fingerprint outputs (.csv, .npz).
- Supplying one model, multiple model files, or directories of model files.
- Understanding averaged ensemble outputs and per-model individual output files.
- Reusing training-time parsing and featurization flags during prediction or fingerprint export.
- Diagnosing model path, output suffix, featurizer, reaction, multicomponent, and checkpoint loading failures.
Route elsewhere when the task is:
- Training, split selection, checkpoint creation, or training output layout: use
training-cli.
- Input schema design, descriptors, atom/bond features, or NPZ side-file alignment: use the data-featurization sub-skill if present.
- Uncertainty method selection, calibration design, conformal interpretation, or calibration feature alignment: use
uncertainty-advanced.
- Model conversion before inference: use
uncertainty-advanced for conversion and compatibility decisions.
- Custom Python dataloaders or model internals: use the Python API sub-skill if present.
Quick Prediction Pattern
Minimum prediction command:
chemprop predict \
--test-path new_inputs.csv \
--model-path models/best.pt \
--output predictions.csv
Core rules:
--test-path must be a .csv file.
--model-path and --model-paths are aliases and accept one or more paths.
- Each model path may be a
.pt model file, .ckpt checkpoint, or directory.
- Directory model paths are searched recursively for
.pt files only; pass .ckpt files explicitly.
- Prediction output may be
.csv or .pkl; if omitted, Chemprop writes <test_stem>_preds.csv beside the input.
- With multiple discovered or supplied models, Chemprop writes averaged predictions to the requested output and a second file named
<output_stem>_individual<suffix> with per-model columns.
See references/prediction-workflows.md for command patterns and output interpretation.
Quick Fingerprint Pattern
Minimum fingerprint command:
chemprop fingerprint \
--test-path new_inputs.csv \
--model-path models/best.pt \
--ffn-block-index 0 \
--output fingerprints.npz
Core rules:
--ffn-block-index is required.
--ffn-block-index 0 returns the post-aggregation representation before FFN layers.
--ffn-block-index 1 returns the first FFN linear block output; higher valid indexes select later FFN blocks.
- Fingerprint output may be
.csv or .npz; if omitted, Chemprop uses <test_stem>_fps.csv as the base output.
- Chemprop appends the model index to every fingerprint output, such as
fingerprints_0.npz, fingerprints_1.npz, or new_inputs_fps_0.csv.
- Atom/bond prediction models can emit kind-specific files with
_mol_fingerprints, _atom_fingerprints, and _bond_fingerprints in the stem.
See references/fingerprint-workflows.md for layer choice and output handling.
Match Training-Time Data Flags
Prediction and fingerprint commands must reuse the structure parsing and featurization choices used to train the model. Important flags include:
--smiles-columns for named molecule columns and multicomponent molecule models.
--reaction-columns plus --rxn-mode/--reaction-mode for atom-mapped reaction SMILES.
--descriptors-path or --descriptors-columns for molecule-level descriptors.
--atom-features-path, --atom-descriptors-path, --bond-features-path, and --bond-descriptors-path for side features.
--multi-hot-atom-featurizer-mode, --keep-h, --add-h, --ignore-stereo, and --reorder-atoms for graph construction compatibility.
Single-molecule default when neither --smiles-columns nor --reaction-columns is supplied: Chemprop reads the first CSV column as SMILES.
Model Artifact Routing
Use references/model-artifacts.md when choosing model paths or interpreting artifacts.
Key facts:
- Chemprop prediction and fingerprint loading first inspect the first model artifact on CPU to detect model type, including atom/bond prediction models.
.pt files are normal exported model artifacts; .ckpt files are Lightning checkpoints that can be loaded when passed explicitly.
- Directories are accepted but discover
.pt files only.
- Prediction target names are loaded from the artifact when available; otherwise outputs use generic names such as
pred_0, pred_1.
- CUDA-trained artifacts can be loaded for CPU prediction because Chemprop loads checkpoint metadata with CPU mapping before inference.
Bundled Command Builder
Use scripts/chemprop_predict_command_builder.py to plan commands without importing Chemprop or loading model files.
Examples:
python scripts/chemprop_predict_command_builder.py predict \
--test-path new_inputs.csv \
--model-path models/ \
--output predictions.csv \
--smiles-columns smiles
python scripts/chemprop_predict_command_builder.py fingerprint \
--test-path new_inputs.csv \
--model-path models/best.pt \
--output fingerprints.npz \
--ffn-block-index 0
The helper validates common suffix mistakes, notes model directory discovery behavior, warns about likely parsing mismatches, and can emit JSON with --json.
Troubleshooting First Pass
Use references/troubleshooting.md for failures.
Fast triage:
- Run
chemprop --help, chemprop predict --help, or chemprop fingerprint --help to confirm CLI availability.
- Confirm input is
.csv and output suffix is legal for the selected subcommand.
- Confirm every model path is a
.pt, .ckpt, or directory, and that directory paths contain .pt files if relying on recursive discovery.
- Reuse the training-time component columns, reaction mode, descriptors, side features, and featurizer mode.
- If a v1 featurizer mismatch warning appears, rerun with
--multi-hot-atom-featurizer-mode v1 or convert/verify the artifact before production inference.
- Prefer
--accelerator cpu --devices 1 --num-workers 0 while debugging checkpoint loading or multiprocessing issues.
1---2name: prediction-fingerprints3description: "Run Chemprop prediction and fingerprint workflows from trained4 model artifacts, including model-path handling, output formats, ensembles, and5 fingerprint layer choices."6disable-model-invocation: true7metadata:8 source: https://skillmd.com/skills/vectorspacelab/prediction-fingerprints9 disco-role: operating10license: NOASSERTION11---1213# Chemprop Prediction and Fingerprints1415Use this sub-skill when an agent needs to run trained Chemprop model artifacts with `chemprop predict` or extract learned encodings with `chemprop fingerprint`. Keep prediction-time command construction, model path discovery, output naming, ensemble individual outputs, fingerprint layer choice, and inference artifact interpretation here.1617## When to Use1819Use this sub-skill for:2021- Building `chemprop predict` commands for CSV inputs and `.pt` or `.ckpt` model artifacts.22- Building `chemprop fingerprint` commands for learned model representations.23- Choosing legal prediction outputs (`.csv`, `.pkl`) or fingerprint outputs (`.csv`, `.npz`).24- Supplying one model, multiple model files, or directories of model files.25- Understanding averaged ensemble outputs and per-model individual output files.26- Reusing training-time parsing and featurization flags during prediction or fingerprint export.27- Diagnosing model path, output suffix, featurizer, reaction, multicomponent, and checkpoint loading failures.2829Route elsewhere when the task is:3031- Training, split selection, checkpoint creation, or training output layout: use [`training-cli`](../training-cli/SKILL.md).32- Input schema design, descriptors, atom/bond features, or NPZ side-file alignment: use the data-featurization sub-skill if present.33- Uncertainty method selection, calibration design, conformal interpretation, or calibration feature alignment: use [`uncertainty-advanced`](../uncertainty-advanced/SKILL.md).34- Model conversion before inference: use [`uncertainty-advanced`](../uncertainty-advanced/SKILL.md) for conversion and compatibility decisions.35- Custom Python dataloaders or model internals: use the Python API sub-skill if present.3637## Quick Prediction Pattern3839Minimum prediction command:4041```bash42chemprop predict \43 --test-path new_inputs.csv \44 --model-path models/best.pt \45 --output predictions.csv46```4748Core rules:4950- `--test-path` must be a `.csv` file.51- `--model-path` and `--model-paths` are aliases and accept one or more paths.52- Each model path may be a `.pt` model file, `.ckpt` checkpoint, or directory.53- Directory model paths are searched recursively for `.pt` files only; pass `.ckpt` files explicitly.54- Prediction output may be `.csv` or `.pkl`; if omitted, Chemprop writes `<test_stem>_preds.csv` beside the input.55- With multiple discovered or supplied models, Chemprop writes averaged predictions to the requested output and a second file named `<output_stem>_individual<suffix>` with per-model columns.5657See [`references/prediction-workflows.md`](references/prediction-workflows.md) for command patterns and output interpretation.5859## Quick Fingerprint Pattern6061Minimum fingerprint command:6263```bash64chemprop fingerprint \65 --test-path new_inputs.csv \66 --model-path models/best.pt \67 --ffn-block-index 0 \68 --output fingerprints.npz69```7071Core rules:7273- `--ffn-block-index` is required.74- `--ffn-block-index 0` returns the post-aggregation representation before FFN layers.75- `--ffn-block-index 1` returns the first FFN linear block output; higher valid indexes select later FFN blocks.76- Fingerprint output may be `.csv` or `.npz`; if omitted, Chemprop uses `<test_stem>_fps.csv` as the base output.77- Chemprop appends the model index to every fingerprint output, such as `fingerprints_0.npz`, `fingerprints_1.npz`, or `new_inputs_fps_0.csv`.78- Atom/bond prediction models can emit kind-specific files with `_mol_fingerprints`, `_atom_fingerprints`, and `_bond_fingerprints` in the stem.7980See [`references/fingerprint-workflows.md`](references/fingerprint-workflows.md) for layer choice and output handling.8182## Match Training-Time Data Flags8384Prediction and fingerprint commands must reuse the structure parsing and featurization choices used to train the model. Important flags include:8586- `--smiles-columns` for named molecule columns and multicomponent molecule models.87- `--reaction-columns` plus `--rxn-mode`/`--reaction-mode` for atom-mapped reaction SMILES.88- `--descriptors-path` or `--descriptors-columns` for molecule-level descriptors.89- `--atom-features-path`, `--atom-descriptors-path`, `--bond-features-path`, and `--bond-descriptors-path` for side features.90- `--multi-hot-atom-featurizer-mode`, `--keep-h`, `--add-h`, `--ignore-stereo`, and `--reorder-atoms` for graph construction compatibility.9192Single-molecule default when neither `--smiles-columns` nor `--reaction-columns` is supplied: Chemprop reads the first CSV column as SMILES.9394## Model Artifact Routing9596Use [`references/model-artifacts.md`](references/model-artifacts.md) when choosing model paths or interpreting artifacts.9798Key facts:99100- Chemprop prediction and fingerprint loading first inspect the first model artifact on CPU to detect model type, including atom/bond prediction models.101- `.pt` files are normal exported model artifacts; `.ckpt` files are Lightning checkpoints that can be loaded when passed explicitly.102- Directories are accepted but discover `.pt` files only.103- Prediction target names are loaded from the artifact when available; otherwise outputs use generic names such as `pred_0`, `pred_1`.104- CUDA-trained artifacts can be loaded for CPU prediction because Chemprop loads checkpoint metadata with CPU mapping before inference.105106## Bundled Command Builder107108Use [`scripts/chemprop_predict_command_builder.py`](scripts/chemprop_predict_command_builder.py) to plan commands without importing Chemprop or loading model files.109110Examples:111112```bash113python scripts/chemprop_predict_command_builder.py predict \114 --test-path new_inputs.csv \115 --model-path models/ \116 --output predictions.csv \117 --smiles-columns smiles118```119120```bash121python scripts/chemprop_predict_command_builder.py fingerprint \122 --test-path new_inputs.csv \123 --model-path models/best.pt \124 --output fingerprints.npz \125 --ffn-block-index 0126```127128The helper validates common suffix mistakes, notes model directory discovery behavior, warns about likely parsing mismatches, and can emit JSON with `--json`.129130## Troubleshooting First Pass131132Use [`references/troubleshooting.md`](references/troubleshooting.md) for failures.133134Fast triage:135136- Run `chemprop --help`, `chemprop predict --help`, or `chemprop fingerprint --help` to confirm CLI availability.137- Confirm input is `.csv` and output suffix is legal for the selected subcommand.138- Confirm every model path is a `.pt`, `.ckpt`, or directory, and that directory paths contain `.pt` files if relying on recursive discovery.139- Reuse the training-time component columns, reaction mode, descriptors, side features, and featurizer mode.140- If a v1 featurizer mismatch warning appears, rerun with `--multi-hot-atom-featurizer-mode v1` or convert/verify the artifact before production inference.141- Prefer `--accelerator cpu --devices 1 --num-workers 0` while debugging checkpoint loading or multiprocessing issues.