Skip to main content

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.

Metadata

Release files for ageml 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ageml 0.3.0
File Size Uploaded
ageml-0.3.0.tar.gz 106.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ageml 0.3.0
File Interpreter ABI Platform
ageml-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 212.5 kB

Release files / ageml-0.3.0.tar.gz

Download URL ageml-0.3.0.tar.gz
Size 106.5 kB
Tags Source
SHA-256 checksum
How to use checksums
653275a2773729f1bdfe249bf45e057013b98b0411a4334d84c401693857400a
BLAKE2b-256 checksum
How to use checksums
7ad35f2cb95ee45af44b1bba888a1bb904dca01bb657d1ef05e115ccf2b7c58e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.2 Linux/5.15.167.4-microsoft-standard-WSL2

Release files / ageml-0.3.0-py3-none-any.whl

Download URL ageml-0.3.0-py3-none-any.whl
Size 106.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60e4f3522a46a918a50b3d7a609b046a71fbecf3b78d01b5482683d8b69e42ac
BLAKE2b-256 checksum
How to use checksums
77b8f5fb8d3534ffe380e7ad222ba77c9fca9aa296eed1730481c0a2c4a55280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.2 Linux/5.15.167.4-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page