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.

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, or JupyterLab? Head to the Getting Started section of the documentation, we explain it all! 🎉

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
    

[!CAUTION] Scikit-longitudinal is currently compatible with Python versions 3.9 only. 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 Forest is a dependency of Scikit-longitudinal that is not compatible with Python versions greater than 3.9. Deep Forest helps us with the Deep Forest algorithm, to which we have made some modifications to welcome Lexicographical 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 installation section in the Getting Started of 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


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.0.tar.gz (14.6 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.0-py3-none-any.whl (120.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scikit_longitudinal-0.1.0.tar.gz
  • Upload date:
  • Size: 14.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.11

File hashes

Hashes for scikit_longitudinal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df8649566544fc95f33f94d32ccd4c0c5b2c44849a2a0c47ac3e7fd6e6fb2303
MD5 d5392fc5dc2c6b1843318c8f877edf17
BLAKE2b-256 1cdd93580df13256087c62d2b80f48967d862b5eab717bb251059d3c88e1ff7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for scikit_longitudinal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b29fa0d74f3d5983395085bc9fa07f998ac6a6152e4bef7da8b91251dad30f5
MD5 3c9ef1092cc6c7642b09e709bc45b000
BLAKE2b-256 a3e8499e70ce065934f5f2cdcbb08d5014a6cb0b8c459eb3ef0926e00e45dd40

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