Skip to main content

AgeML is a Python package for Age Modelling with Machine Learning made easy.

Project description

AgeML: Age modelling with Machine Learning

ageml is a Python package for Age Modelling with Machine Learning made easy.

Zenodo doi badge PyPI version Lint Test Coverage

Description

pipelines_figure ageml allows age modelling with a set of simple-to-use CLIs that produce comprehensive figures of the modelling steps and detailed logs for exploring the effectiveness of the trained models.

There are 4 main CLIs:

  • model_age: Trains a model to predict chronological age from features, with optional categorical and system-based covariates, and outputs predicted ages, age deltas, correlation analysis, and distribution plots.
  • factor_correlation: Analyzes the correlation between provided factors and age deltas, including significance, with optional stratification by clinical category.
  • clinical_groups: Generates boxplots and age distribution plots to visualize age delta differences across clinical groups.
  • clinical_classify: Performs classification between two clinical groups using features and age deltas, outputting ROC curves for each model.

pipeline2_figure

There are also 2 extra CLIs:

  • model_feature_influence : Analyzes the effect of different feature selection methods when creating deltas that will be used as input in classification tasks.
  • age_model_vs_logistic_regression: Compares the use of deltas for classification to using the features directly in a logistic regressor.

How to use ageml

A comprehensive, step by step tutorial of the tool can be found here. You can also tinker around with our getting started Colab notebook if you want a more interactive experience.

For more indepth discussion on methods see the publication AgeML: Age modelling with Machine Learning

How to cite

If you use ageml in your work, please cite the all-time:

J. Garcia Condado, I. Tellaetxe Elorriaga, J. M. Cortes and A. Erramuzpe, "AgeML: Age modeling with Machine Learning," in IEEE Journal of Biomedical and Health Informatics, doi: 10.1109/JBHI.2025.3531017.

@article{AgeML,
  title = {{{AgeML}}: {{Age}} Modeling with {{Machine Learning}}},
  shorttitle = {{{AgeML}}},
  author = {Garcia Condado, Jorge and Tellaetxe Elorriaga, Iñigo and Cortes, Jesus M. and Erramuzpe, Asier},
  date = {2025},
  journaltitle = {IEEE Journal of Biomedical and Health Informatics},
  shortjournal = {IEEE J. Biomed. Health Inform.},
  pages = {1--11},
  issn = {2168-2194, 2168-2208},
  doi = {10.1109/JBHI.2025.3531017},
  url = {https://ieeexplore.ieee.org/document/10844538/},
  urldate = {2025-01-29}
}

If you also used model_feature_influence or age_model_vs_logistic_regression please cite:

J. Garcia Condado, I. Verdugo Recuero, I. Tellaetxe Elorriaga, C. Birkhenbihl, M. Carrigan, R. Buckley, A. Erramuzpe and J. M. Cortes, "Aging as an active player in Alzheimer's Disease Classification: Insights from feature selection in BrainAge Models," in MedrXiv, doi: 10.1101/2025.04.16.25325953

@article {AgeingBrainAgeAlzheimer,
	title = {Aging as an active player in Alzheimer's Disease Classification: Insights from feature selection in BrainAge Models},
	author = {Garcia Condado, Jorge and Verdugo Recuero, Ines and Elorriaga Tellaetxe, Iñigo and Birkhenbil, Colin and Carrigan, Maria and Diez, Ibai and Buckley, Rachel F and Erramuzpe, Asier and Cortes, Jesus M and the Alzheimer's Disease Neuroimaging Initiative},
	year = {2025},
	doi = {10.1101/2025.04.16.25325953},
	journal = {medRxiv}
}

How to install ageml

Using pip (recommended)

From your terminal, for basic installation, run: pip install ageml

Cloning from Github

Note that ageml is under active development, but still not continuously deployed, so the latest version might not be available in PyPI. If you want to use the latest version, you can clone the repository and install it locally.

From your terminal, run: git clone https://github.com/compneurobilbao/ageml.git Then cd into the ageml folder, and install with pip:pip install .

Docker

There are two Dockerfiles available for ageml.

  • One that installs ageml from pip -> ./Dockerfile
  • Another one for the latest version of ageml, which installs it from the GitHub repo main branch.

To build the pip image, run: docker build -t ageml:pip -f Dockerfile <path_to_directory_containing_Dockerfile> To build the latest image, run: docker build -t ageml:latest -f Dockerfile <path_to_directory_containing_Dockerfile>

To run the container, run: docker run -it ageml:<tag_of_your_image>

A developer Dockerfile will be available in the future for contributing to the project in a containerized fashion.

Developer installation

The developer installation is described in the contribution guidelines.

How to Contribute to the project

We welcome scientists and developers who want to standardize the procedures of age modelling, share pretrained models or whatever other kind of contribution that can help the project.

The contribution guidelines can be found here.

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

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

ageml-0.3.0.tar.gz (106.5 kB view details)

Uploaded Source

Built Distribution

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

ageml-0.3.0-py3-none-any.whl (106.0 kB view details)

Uploaded Python 3

File details

Details for the file ageml-0.3.0.tar.gz.

File metadata

  • Download URL: ageml-0.3.0.tar.gz
  • Upload date:
  • Size: 106.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for ageml-0.3.0.tar.gz
Algorithm Hash digest
SHA256 653275a2773729f1bdfe249bf45e057013b98b0411a4334d84c401693857400a
MD5 620a3725ec7690ecd442b7e28301e24e
BLAKE2b-256 7ad35f2cb95ee45af44b1bba888a1bb904dca01bb657d1ef05e115ccf2b7c58e

See more details on using hashes here.

File details

Details for the file ageml-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ageml-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 106.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for ageml-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60e4f3522a46a918a50b3d7a609b046a71fbecf3b78d01b5482683d8b69e42ac
MD5 a4d2a61db86af60bcfd96ba25e409d06
BLAKE2b-256 77b8f5fb8d3534ffe380e7ad222ba77c9fca9aa296eed1730481c0a2c4a55280

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