Scikit-longitudinal is an open-source Python library for longitudinal data analysis, building on Scikit-learn's foundation with tools tailored for repeated measures data.
Project description
A Scikit-Learn-like Python library for Longitudinal Machine Learning — Paper · Documentation · PyPi Index
About The Project
Scikit-longitudinal (Sklong) is a machine learning library tailored for Longitudinal machine (supervised) learning (Classification tasks focussed as of today). It offers tools and models for processing, analysing, and predicting longitudinal data, with a user-friendly interface that integrates with the Scikit-learn ecosystem.
Wait, what is Longitudinal Data — In layman's terms?
Longitudinal data is a "time-lapse" snapshot of the same subject, entity, or group tracked over time-periods, similar to checking in on patients to see how they change. For instance, doctors may monitor a patient's blood pressure, weight, and cholesterol every year for a decade to identify health trends or risk factors. This data is more useful for predicting future results than a one-time (cross-sectional) survey because it captures evolution, patterns, and cause-effect throughout time.
See more in the documentation.
Installation
To install Scikit-longitudinal:
pip install Scikit-longitudinal
To install a specific version:
pip install Scikit-longitudinal==0.1.0
[!TIP] Want to use
Jupyter Notebook/Lab,Google Colabor want to activate parallelism? Head to the Getting Started section of the documentation, we explain it all! 🎉
Getting Started
Let's run a simple Longitudinal machine learning classification task:
from scikit_longitudinal.data_preparation import LongitudinalDataset
from scikit_longitudinal.estimators.ensemble.lexicographical.lexico_gradient_boosting import LexicoGradientBoostingClassifier
dataset = LongitudinalDataset('./stroke.csv') # Note, this is a fictional dataset. Use yours!
dataset.load_data_target_train_test_split(
target_column="class_stroke_wave_4",
)
# Pre-set or manually set your temporal dependencies
dataset.setup_features_group(input_data="elsa")
model = LexicoGradientBoostingClassifier(
features_group=dataset.feature_groups(),
threshold_gain=0.00015 # Refer to the API for more hyper-parameters and their meaning
)
model.fit(dataset.X_train, dataset.y_train)
y_pred = model.predict(dataset.X_test)
# Classification report
print(classification_report(y_test, y_pred))
How to Cite
If you use Sklong in your research, please cite our paper:
We would like to personally thank Prof. Lengerich (UW Madison—@blengerich & @AdaptInfer), & Prof. Tahiri (Université de Sherbrooke—@TahiriNadia & @tahiri-lab) for their amazing peer reviews!
@article{Provost2025,
doi = {10.21105/joss.08481},
url = {https://doi.org/10.21105/joss.08481},
year = {2025},
publisher = {The Open Journal},
volume = {10},
number = {112},
pages = {8481},
author = {Provost, Simon and Freitas, Alex A.},
title = {Scikit-Longitudinal: A Machine Learning Library for Longitudinal Classification in Python},
journal = {Journal of Open Source Software}
}
License
Scikit-longitudinal is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scikit_longitudinal-0.1.9.tar.gz.
File metadata
- Download URL: scikit_longitudinal-0.1.9.tar.gz
- Upload date:
- Size: 45.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3d281fe7801e91f2c2c192ba2cc0f03186207c03410aaba059dcbabc2b9d19e
|
|
| MD5 |
185a8dea0defd2f312101046c21406ae
|
|
| BLAKE2b-256 |
719f25292d6c81f4f9a475a068cf4fd8f2cbaf72255afb9b19797f03231070c9
|
File details
Details for the file scikit_longitudinal-0.1.9-py3-none-any.whl.
File metadata
- Download URL: scikit_longitudinal-0.1.9-py3-none-any.whl
- Upload date:
- Size: 142.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76041a63aa302bf732198a97ba9376d33962299bb1901e93629d7326e7445c5d
|
|
| MD5 |
f4f4d061778b55f9626ed220f71c8e65
|
|
| BLAKE2b-256 |
8412ec3135c2984bc5eb192e6fac814c4bee151ba7a1cc87864072ee2577a9cd
|