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.19.tar.gz (292.0 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.19-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abil-25.2.19.tar.gz
  • Upload date:
  • Size: 292.0 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.19.tar.gz
Algorithm Hash digest
SHA256 2c8e78530bcba5a02b97f0cd9966ab3ea912172e84c26f9af51d9e732b448218
MD5 5399e6bc0814fcac0b558db3012371b5
BLAKE2b-256 38be2c193c9acbc94dc032f53c658a2c5e64853ed77b27d5a5f345355d54a470

See more details on using hashes here.

File details

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

File metadata

  • Download URL: abil-25.2.19-py3-none-any.whl
  • Upload date:
  • Size: 33.9 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.19-py3-none-any.whl
Algorithm Hash digest
SHA256 e0daa4e967e2f551d8fbe05dd1de37cf91740f6b60e96f403ca9bfda9e44b7f7
MD5 8eff172d691032fed9ff180dd189a670
BLAKE2b-256 3b82f70958dd0afce0cbea6a92a6e9bbf1841ca9f36087336b2390ec507885b6

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