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.17.tar.gz (298.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.17-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for abil-25.2.17.tar.gz
Algorithm Hash digest
SHA256 e421b98eaf1f91e8f6498b65bf720eb370ce58276206da6f6229d1e3434e2f61
MD5 633eb5801c1276486fdcaa56b0abbc3d
BLAKE2b-256 581f6388a4330a8215228ba68bb426fb4b5c3024c17552f6435b1ac55c37201c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for abil-25.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 f7e64b93906e58933cf792f8c9f0540f9a32db8e8ef5c23e87cc097ee0d3b22f
MD5 3a506fb99f1e50b40ce49132be9b3248
BLAKE2b-256 d9decf7bc8f3188db97a251567668cae2caf9db2d41ea731731e368499807095

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