The TaxonBodyMassML model is available as standalone R and Python packages for programmatic access to body mass predictions. The packages resolve species names automatically via the GBIF fuzzy-match API (with NCBI Entrez as a fallback), download the XGBoost model from Hugging Face Hub on first use (~2 GB, cached locally), and run inference entirely on your machine.
Install using pak:
# install.packages("pak")
pak::pkg_install("url::https://github.com/TaxonBodyMassML/TaxonBodyMassML/releases/download/r-v0.2.2/TaxonBodyMassML_0.2.2.tar.gz")
Quick start:
# Single species
TaxonBodyMassML::predict_mass("Haustrum scobina")
# Multiple species with 90% confidence interval
TaxonBodyMassML::predict_mass(c("Haustrum scobina", "Mus musculus"),
confidence_interval = TRUE)
See the Getting Started vignette for full usage including confidence intervals, taxonomy lookup, disk caching, and citation instructions.
Install using pip:
pip install "https://github.com/TaxonBodyMassML/TaxonBodyMassML/releases/download/python-v0.2.2/taxonbodymassml-0.2.2-py3-none-any.whl"
Quick start:
import taxonbodymassml as tbm
# Single species
tbm.predict_mass("Haustrum scobina")
# Multiple species with 90% confidence interval
tbm.predict_mass(["Haustrum scobina", "Mus musculus"], confidence_interval=True)
Model artifacts (~2 GB) are downloaded automatically on first use and cached in your local application data directory. An internet connection is required for the initial download and for each species name lookup. See the README for API compliance setup (NCBI User-Agent and API key configuration).
Source code and full documentation: github.com/TaxonBodyMassML/TaxonBodyMassML