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 Scikit-Learn-like Python library for Longitudinal Machine Learning — Paper · Documentation

💡 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 Colab or 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:

JOSS DOI badge

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


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.8.tar.gz (33.2 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.8-py3-none-any.whl (135.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for scikit_longitudinal-0.1.8.tar.gz
Algorithm Hash digest
SHA256 4994ce6d6071a9b14847b73183cd8a357c906cd727fdce46b490af01d6929603
MD5 dc8db679bd360b92e67d1cd837dd828d
BLAKE2b-256 c2d5734fe3543ee639f5088ae60cb9388b263deb22e87ff6e79afb828dfb67ad

See more details on using hashes here.

File details

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

File metadata

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

Hashes for scikit_longitudinal-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 39fcc63fa579e6cdbdf9d59678c0501f50d67318740cd0f6b3b227aeeda04be5
MD5 a575691f680815d0bb96b9ce819972e5
BLAKE2b-256 db5954814d4cd2e1fbcf22abfaf317572108fe612e27740685de3099ca2597c6

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