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
- 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)
- 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')
- 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.
Metadata
Release files for mtslearn 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mtslearn-0.1.1.tar.gz | 27.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mtslearn-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 75.2 MB
Release files / mtslearn-0.1.1.tar.gz
| Download URL | mtslearn-0.1.1.tar.gz |
|---|---|
| Size | 27.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc57cd1af410a8deafa631fa1249007469b2d7976e838a0ff0d65a3fac6a1e01
|
|
BLAKE2b-256 checksum How to use checksums |
cd61f6fb65c15cf3ab5622c0903814f5f3a4fdb983a3d7c77f72e58167c0d718
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / mtslearn-0.1.1-py3-none-any.whl
| Download URL | mtslearn-0.1.1-py3-none-any.whl |
|---|---|
| Size | 48.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
191ffb3b47c93d447ba87f258587ebbd7e0d586a6efad0ac427cfe0e937a66ec
|
|
BLAKE2b-256 checksum How to use checksums |
503c35f77b93bf544bfc84f7f1410b522e9bd545e2e703911b8122ff6423867d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|