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.24.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.24-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abil-25.2.24.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.24.tar.gz
Algorithm Hash digest
SHA256 c08775a68471509c77cece7dd0a3506225787145519ca8241a8d8023d3d7df3d
MD5 e33adafa73e59cb5a56b053b381b78d8
BLAKE2b-256 93bc37529be8726444ecd15bfbe9059fed77b6303a93f5be72b3b78bb373f5b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: abil-25.2.24-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.24-py3-none-any.whl
Algorithm Hash digest
SHA256 8247c0bbfbf8c4a04424e05dcea06737284c96ec002c9ca161a3eba762ccd417
MD5 ce9b2914e668d2c23b03a3a12bbd3827
BLAKE2b-256 59b95555df144e8196fd37bbf8228ba82b825a532aaf82a0826c42e58333bb59

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