Skip to main content

Aquatic Biogeochemical Interpolation Library

Project description

Abil.py · GitHub license Build Status

Overview

Abil.py provides functions to interpolate distributions of biogeochemical observations using Machine Learning algorithms in Python. The library is optimized to interpolate many predictions in parallel and is thus particularly suited for distribution models of species, genes and transcripts. The library relies on scikit-learn.

Current support (v0.10):

  • Random Forest, XGBoost, Bagged KNN

  • Continuous data

  • 2-phase zero-inflated models

  • Hyperparameter tuning and cross-validation

  • Automatic feature scaling and one-hot-encoding

  • Example SLURM and Singularity scripts

Generally the workflow is as follows:

  1. Define the model setup in a model_config.yml file (for an example see /examples/configuration/)
  2. Tune the model for the species of interest using tune.py
  3. Predict the distribution of each species using predict.py
  4. Merge the predictions into a single netcdf and do post processing using post.py

Examples for each step are provided in the respective Jupyter notebooks which can be found in /examples/notebooks.

Directory structure

The recommended directory structure is:

Abil
├── abil
|   └── __init__.py
|   └── functions.py
|   └── post.py
|   └── predict.py
|   └── tune.py
├── dist
|   └── abil-0.0.9.tar.gz
|   └── abil-0.0.9-py3-none-any.whl
├── docs
├── examples
|   └── conda
|       └── environment.yml
|   └── configuration
|       └── 2-phase.yml
|       └── classifier.yml
|       └── regressor.yml
|   └── data
|       └── prediction.csv
|       └── targets.csv
|       └── training.csv
|   └── hpc_example
|       └── hpc_post.py
|       └── hpc_predict.py
|       └── hpc_tune.py
|       └── post.sh
|       └── predict.sh
|       └── README.md
|       └── tune_KNN.sh
|       └── tune_RF.sh
|       └── tune_XGB.sh
|   └── notebooks
|       └── tune.ipynb
|       └── predict.ipynb
|       └── post.ipynb
|   └── singularity
|       └── singularity.sif
├── studies
|   └── devries2024
├── tests
├── README.md
├── pyproject.toml
└── README.md

Installing the package:

Install the dependencies in a new environment:

conda env create -f package_save_path/examples/conda/environment.yml

Activate the new environment and install Abil:

conda activate abil-env

python -m pip install package_save_path/Abil/dist/abil-0.0.9.tar.gz

Updating the package:

If you have changed the scripts and want to update the package, a new version can be build.

CD to the planktonSDM directory, then run:

python3 -m build

Note: if you want to change the version name of the package, this can be changed in:

pyproject.toml

Running the model on a hpc cluster

See: /examples/hpc_example/README.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abil-25.2.22.tar.gz (911.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abil-25.2.22-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file abil-25.2.22.tar.gz.

File metadata

  • Download URL: abil-25.2.22.tar.gz
  • Upload date:
  • Size: 911.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for abil-25.2.22.tar.gz
Algorithm Hash digest
SHA256 aab5b18eb5bb0d012d133ada652fe23aefeb086af52e52b3f39ebd86899e89cb
MD5 9c37cc0344b8412292ce70de8038b9d7
BLAKE2b-256 914c9fe49738df84e9f78624fb1e90f22e1935eae9d99f386be2468e8ccb4e74

See more details on using hashes here.

File details

Details for the file abil-25.2.22-py3-none-any.whl.

File metadata

  • Download URL: abil-25.2.22-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for abil-25.2.22-py3-none-any.whl
Algorithm Hash digest
SHA256 0a622268b17fe19a73fda8d74e9ecaa8068e7c7c38cc09b5b3d6ef13277a9671
MD5 2414eaebe29c32568fedcee638c460e3
BLAKE2b-256 0e2d4f153b950453c1297696cff1c75e615000d3f1fe048434c98109f5e2e827

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page