This article introduces scikit-fingerprints, an open-source Python library built on RDKit that implements molecular fingerprints and cheminformatics functionality fully compatible with the scikit-learn interface, bringing cheminformatics capabilities into the scikit-learn ecosystem.
Molecular fingerprints and related functionality are core, widely used tools in the field of cheminformatics.
The widely used open-source cheminformatics frameworks are currently incompatible with the broader Python machine learning ecosystem built on scikit-learn conventions. Developers cannot directly plug commonly used cheminformatics capabilities such as molecular fingerprint computation, molecular filters, similarity and distance metrics, applicability domain estimation, and data splitting strategies into standard machine learning pipelines, and the entire workflow from raw SMILES string processing to final model deployment requires substantial additional adaptation work.
The core contribution of scikit-fingerprints is to fully integrate a broad range of cheminformatics capabilities into the scikit-learn ecosystem. Built on RDKit, it unifies molecular fingerprints, molecular filters, distance and similarity metrics, applicability domain estimation, scaffold-aware and diversity-aware data splitting, fingerprint-aware hyperparameter tuning, virtual screening metrics, and curated benchmark datasets under a single, consistent interface. The figure below gives readers an intuitive overview of the library's full functional classification layout.
The library is fully open source, distributed under the permissive MIT license, is available on PyPI, with code hosted in a public GitHub repository, and provides extensive documentation and tutorials on both GitHub and the official documentation site.
The core design decision of scikit-fingerprints is that all molecular fingerprint generation modules uniformly follow the scikit-learn Transformer interface specification. After parsing molecules internally, the modules consistently return dense NumPy arrays or sparse SciPy CSR matrices, and all behavior configuration options are passed through constructor parameters, such as the output length of hashed fingerprints or whether the output is binary or count values. This interface-level consistency ensures that different fingerprint implementations can be directly interchanged or combined within scikit-learn pipelines.
All fingerprint-related Transformers are implemented as stateless, so their .fit() methods are empty implementations, allowing them to plug directly into standard workflow components of the scikit-learn ecosystem such as pipelines, cross-validation, and grid search without any additional adaptation logic.
The molecular filter modules in the library are likewise wrapped as Transformers conforming to this interface specification. Currently more than 30 built-in filters are provided; given molecules as input, they return the subset that satisfies the rules, while also supporting returning detailed per-molecule results of whether each passed or failed a specific filtering condition. Implementing custom filters has a low barrier: developers only need to inherit from the base filter class and override the _apply_mol_filter() method.
The similarity and distance metric module has also been adapted to the scikit-learn ecosystem, implemented entirely on NumPy and SciPy arrays. It covers classic metrics including Tanimoto, Dice, Sokal-Sneath, and Kulczynski, as well as metrics based on direct molecular graph comparison such as maximum common substructure and Fraggle — over ten metrics in total. Each is provided in both similarity and distance forms, and where applicable also in binary and count variants.
scikit-fingerprints implements the FingerprintEstimatorGridSearch class, which optimizes the redundancy problem that occurs when scikit-learn's native GridSearchCV is combined with Pipeline: molecular fingerprints are recomputed for every parameter combination and cross-validation fold. When tuning downstream classifiers, it reuses already-generated fingerprints for the corresponding hyperparameters. Such optimizations yield especially significant performance gains for more computationally expensive fingerprint types and larger downstream parameter grids.
For batch N×N similarity matrix computation, scikit-fingerprints uses sparse CSR matrix operations, whereas RDKit only supports one-to-one and one-to-many similarity evaluation, incurring substantial function call overhead. This implementation is markedly faster for such tasks and exhibits better scalability as data volume grows. You can combine the growth trends of the two curves in the figure to intuitively compare the time costs of the two tools at different molecular scales.
Beyond efficiency optimizations for hyperparameter tuning scenarios, for large-scale fingerprint computation scikit-fingerprints uses sparse fingerprint implementations to optimize memory usage, enabling fingerprint generation for molecular libraries of hundreds of thousands to tens of millions of molecules on consumer-grade hardware, with high scalability in both wall-clock time and memory footprint. Measured results show that sparse storage can save up to 45 times the memory compared to dense storage, substantially lowering the hardware barrier for large-scale molecular processing.
scikit-fingerprints is released under the MIT open-source license and openly welcomes community contributions. Its core goal is to continuously lower the barrier to reproducible, production-ready molecular machine learning.