Skip to main content

The Medical Time-Series Analysis Toolkit mtslearn is designed to process and analyze complex, irregularly sampled medical data.

Project description

Medical Time-Series Analysis Toolkit (mtslearn)

The Medical Time-Series Analysis Toolkit mtslearn is designed to process and analyze complex, irregularly sampled medical data. It provides a streamlined pipeline from raw data cleaning and resampling to advanced predictive modeling using both Machine Learning (XGBoost) and Deep Learning (T-LSTM).

🌟 Key Features

  • Multi-Format Data Support: Handles both Static and Time-Series data processing workflows.
  • Flexible Data Ingestion: Supports both Wide and Long data formats commonly found in clinical electronic health records (EHR).
  • Advanced Temporal Modeling: Features T-LSTM (Time-Aware LSTM) to specifically handle irregular time intervals between patient visits.
  • Diverse Model Integration: Supports a variety of architectures, from XGBoost and CoxPH for static features to LSTM, T-LSTM, and Transformer for time series features.
  • End-to-End Pipeline: Integrated modules for data cleaning, outlier detection, resampling, standardization, and performance evaluation (ROC/Confusion Matrix for static outputs, Error Distributions for temporal outputs).

🛠 Installation

You can now install the toolkit and all its dependencies directly via pip:

pip install mtslearn

🚀 Quick Start

  1. Data Loading & Feature Engineering
from mtslearn import StaticProcessor, Static_Static_Classifier

static_processor = StaticProcessor()
static_processor.load_dataset("COVID-19")  # Built-in dataset
static_processor.extract_features(agg_funcs=['mean', 'std', 'max', 'min', 'median'], include_duration=True)
  1. Data Preprocessing & Cleaning
X_train_static, X_test_static, y_train_static, y_test_static = static_processor.train_test_split(
    test_size=0.3, shuffle=True, random_state=42, stratify=True
) # data Splitting
X_train_static, X_test_static = static_processor.data_cleaning(
    X_train_static, X_test_static, fill_missing='mean', outlier_method='iqr'
) # data cleaning
# standardization
X_train_static, X_test_static = static_processor.scale_features(X_train_static, X_test_static, method='standardize')
  1. Model Training & Evaluation
model = Static_Static_Classifier(model_type='XGB') 
model.fit(X_train_static, y_train_static)
model.evaluate(X_test_static, y_test_static)

For more in-depth examples, refer to 🔗 test.ipynb, which demonstrates the complete workflow for both static and time-series processes.

Documentation

For detailed documentation, including advanced usage, customization options, and examples, refer to the User Guide .

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or issues, please open an issue on GitHub or contact us as 202363010015@nuist.edu.cn.

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

mtslearn-0.1.1.tar.gz (27.3 MB view details)

Uploaded Source

Built Distribution

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

mtslearn-0.1.1-py3-none-any.whl (48.0 MB view details)

Uploaded Python 3

File details

Details for the file mtslearn-0.1.1.tar.gz.

File metadata

  • Download URL: mtslearn-0.1.1.tar.gz
  • Upload date:
  • Size: 27.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for mtslearn-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dc57cd1af410a8deafa631fa1249007469b2d7976e838a0ff0d65a3fac6a1e01
MD5 ec1fec3f41ec397835dcfb62a4dfc238
BLAKE2b-256 cd61f6fb65c15cf3ab5622c0903814f5f3a4fdb983a3d7c77f72e58167c0d718

See more details on using hashes here.

File details

Details for the file mtslearn-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mtslearn-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 48.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for mtslearn-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 191ffb3b47c93d447ba87f258587ebbd7e0d586a6efad0ac427cfe0e937a66ec
MD5 0f5b6715eb5d592e3982f71be7376064
BLAKE2b-256 503c35f77b93bf544bfc84f7f1410b522e9bd545e2e703911b8122ff6423867d

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