Skip to main content

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
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?


🛠️ Installation

[!NOTE] Want to be using Jupyter Notebook, Marimo, Google Colab, or JupyterLab? Head to the Getting Started section of the documentation, we explain it all! 🎉 Additionally, note that Scikit-longitudinal works on Python 3.10+ to 3.12.

To install Scikit-longitudinal:

  1. ✅ Install the latest version:

    pip install Scikit-longitudinal
    

    To install a specific version:

    pip install Scikit-longitudinal==0.1.0
    

Need Ray-backed parallelism? Install the optional extra:

pip install Scikit-longitudinal[parallelisation]

Parallel features automatically prompt you to install this extra when missing.


🚀 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scikit_longitudinal-0.1.6.tar.gz (33.1 MB view details)

Uploaded Source

Built Distribution

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

scikit_longitudinal-0.1.6-py3-none-any.whl (126.0 kB view details)

Uploaded Python 3

File details

Details for the file scikit_longitudinal-0.1.6.tar.gz.

File metadata

  • Download URL: scikit_longitudinal-0.1.6.tar.gz
  • Upload date:
  • Size: 33.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"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

Hashes for scikit_longitudinal-0.1.6.tar.gz
Algorithm Hash digest
SHA256 8e094bcf09f30a1a52c65815b585775c074afe8af2d51394a4e7f4f77e309db7
MD5 f109c6dce702a81238780496b9d12692
BLAKE2b-256 047454819e528f98e3bb964248a79ca1a44c95007b4c38926b317b10ecb046ee

See more details on using hashes here.

File details

Details for the file scikit_longitudinal-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: scikit_longitudinal-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 126.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"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

Hashes for scikit_longitudinal-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c89e78738e46e4f72bcdbf1fc0c0daa9c3c291e7170a2d3adee14dfb53b6944c
MD5 972f2b2df4200c6ae1335623ac61f89d
BLAKE2b-256 c01c9268e76a1415df893d9a89b3df99e37b60ce6dd84196430f0aab8db4ad52

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