Skip to main content

MLChemAD

Applicability domain definitions for cheminformatics modelling.

Getting Started

Install

pip install mlchemad

Example Usage

  • With molecular fingerprints, prefer the use of the KNNApplicabilityDomain with k=1, scaling=None, hard_threshold=0.3, and dist='jaccard'.
  • Otherwise, the use of the TopKatApplicabilityDomain is recommended.
from mlchemad import TopKatApplicabilityDomain, KNNApplicabilityDomain, data

# Create the applicability domain using TopKat's definition
app_domain = TopKatApplicabilityDomain()
# Fit it to the training set
app_domain.fit(data.mekenyan1993.training)

# Determine outliers from multiple samples (rows) ...
print(app_domain.contains(data.mekenyan1993.test))

# ... or a unique sample
sample = data.mekenyan1993.test.iloc[5] # Obtain the 5th row as a pandas.Series object 
print(app_domain.contains(sample))

# Now with Morgan fingerprints
app_domain = KNNApplicabilityDomain(k=1, scaling=None, hard_threshold=0.3, dist='jaccard')
app_domain.fit(data.broccatelli2011.training.drop(columns='Activity'))
print(app_domain.contains(data.broccatelli2011.test.drop(columns='Activity')))

Depending on the definition of the applicability domain, some samples of the training set might be outliers themselves.

Applicability domains

The applicability domain defined by MLChemAD as the following:

  • Bounding Box
  • PCA Bounding Box
  • Convex Hull
    (does not scale well)
  • TOPKAT's Optimum Prediction Space
    (recommended with molecular descriptors)
  • Leverage
  • Hotelling T²
  • Distance to Centroids
  • k-Nearest Neighbors
    (recommended with molecular fingerprints with the use of dist='rogerstanimoto', scaling=None and hard_threshold=0.75 for ECFP fingerprints)
  • Isolation Forests
  • Non-parametric Kernel Densities

Metadata

Release files for mlchemad 1.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlchemad 1.5.2
File Size Uploaded Provenance Actions
mlchemad-1.5.2.tar.gz 286.2 kB Without provenance Details for mlchemad-1.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mlchemad 1.5.2
File Interpreter ABI Platform Actions
mlchemad-1.5.2-py3-none-any.whl Python 3 none any Details for mlchemad-1.5.2-py3-none-any.whl

Total release size: 600.5 kB

Release files / mlchemad-1.5.2.tar.gz

Download URL mlchemad-1.5.2.tar.gz
Size 286.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b0f2c6d6b8c639e0c873f14af0364693ad7b3e9641705441464d5e1816168a41
BLAKE2b-256 checksum
How to use checksums
581d2452236c0e6cfcaf451f56dbbfe5bcc91354411e983d99cdc7a62af3314a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / mlchemad-1.5.2-py3-none-any.whl

Download URL mlchemad-1.5.2-py3-none-any.whl
Size 314.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b578ceca58139578c84843aa851aa14430e3748bcf339a7b9a12ad94dbddfa3e
BLAKE2b-256 checksum
How to use checksums
984937b077b10c2bd780bf16a79cdf15d6f1dd0cf49ea51a0162ee0477989a4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for mlchemad 1.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page