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
Scikit-longitudinal
A specialised Python library for longitudinal data analysis built on Scikit-learn
💡 About The Project
Scikit-longitudinal (Sklong) is a machine learning library designed to analyse
longitudinal data (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 survey because it captures evolution, patterns, and cause-effect throughout time.
Not enough?
- For more scientific details, you can refer to our paper published in the Journal of Open Source Software (JOSS).
- For more technical details, visit the official documentation.
🛠️ Installation
[!NOTE] Want to be using
Jupyter Notebook,Marimo,Google Colab, orJupyterLab? Head to theGetting Startedsection of the documentation, we explain it all! 🎉
To install Scikit-longitudinal:
-
✅ Install the latest version:
pip install Scikit-longitudinal
To install a specific version:
pip install Scikit-longitudinal==0.1.0
[!CAUTION]
Scikit-longitudinalis currently compatible with Python versions3.9only. Ensure you have one of these versions installed before proceeding with the installation.Now, while we understand that this is a limitation, we are tied for the time being because of
Deep Forest.Deep Forestis a dependency ofScikit-longitudinalthat is not compatible with Python versions greater than3.9.Deep Foresthelps us with theDeep Forestalgorithm, to which we have made some modifications to welcomeLexicographical Deep Forest.To follow up on this discussion, please refer to this github issue.
If you encounter any errors, feel free to explore further the
installationsection in theGetting Startedof the documentation. If it still doesn't work, please open an issue on GitHub.
🚀 Getting Started
Here's how to analyse longitudinal data with Scikit-longitudinal:
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:
@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.2.tar.gz.
File metadata
- Download URL: scikit_longitudinal-0.1.2.tar.gz
- Upload date:
- Size: 14.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c1b45a8f837e7837f22cae55066f054f10ae0ec2aaa1a993fbd199a588644f6
|
|
| MD5 |
b40d6ce501e7e2f7a342d904b3935c16
|
|
| BLAKE2b-256 |
9157956bc34d25e3a71a0f3188634e3cd165d6c09ea3ee8341e54df15ec38c3c
|
File details
Details for the file scikit_longitudinal-0.1.2-py3-none-any.whl.
File metadata
- Download URL: scikit_longitudinal-0.1.2-py3-none-any.whl
- Upload date:
- Size: 123.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb3ba16624e8ebbb0acd5661fb2a3ae59930ce9c2b0ec24240860c0dbc4a3b49
|
|
| MD5 |
801017e7803de6b03763653b1b2b4ca9
|
|
| BLAKE2b-256 |
b5109dce7bb0261e3938466c4b85f7d90e33ba4432d7e825c51587b41db1a3dd
|