| Name | mtslearn JSON |
| Version |
0.0.1
JSON |
| download |
| home_page | https://github.com/WalkerZYC/mtslearn |
| Summary | A Python Package for ML using Irregularly Sampled Medical Time Series Data |
| upload_time | 2024-09-05 13:18:57 |
| maintainer | None |
| docs_url | None |
| author | Walker ZYC |
| requires_python | >=3.6 |
| license | None |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# **Medical Irregular Time-Series Data Analysis Toolkit**
## **Overview**
The Medical Time-Series Data Analysis Toolkit `mtslearn` is designed to empower healthcare professionals and researchers with tools to analyze and interpret time-series medical data. It offers a comprehensive set of features for extracting key clinical metrics, preparing data for modeling, evaluating predictive models, and visualizing the results. The toolkit is specifically tailored to handle complex datasets, such as longitudinal irregular sampled patient records, and provides meaningful insights to support informed clinical decision-making.
## **Features**
- **Feature Extraction**: Automatically extract meaningful features from time-series data, including statistical measures and temporal dynamics.
- **Data Preparation**: Handle missing data, balance datasets, and split data into training and testing sets with ease.
- **Model Evaluation**: Supports multiple model types (Logistic Regression, Cox Proportional Hazards, XGBoost, Lasso) and evaluates model performance with key metrics.
- **Visualization**: Generate visualizations such as boxplots and correlation matrices to help interpret clinical data and model outcomes.
## **Installation**
### **Clone the Repository**
To download and use the toolkit from GitHub, start by cloning the repository:
```
git clone https://github.com/WalkerZYC/mtslearn.git
cd mtslearn
```
### **Install Dependencies**
Next, install the required dependencies:
```
pip install -r requirements.txt
```
Alternatively, you can manually install the necessary Python packages:
```
pip install pandas numpy scikit-learn matplotlib seaborn xgboost lifelines imbalanced-learn
```
## **Quickstart**
### **1. Prepare Your Data**
Ensure your data is in a pandas DataFrame with the following structure:
- `Patient_ID`: Unique identifier for each patient.
- `Record_Time`: Timestamp of the record.
- `Outcome`: Outcome variable, indicating the result of treatment or condition.
- `Clinical Measurements`: Relevant clinical data (e.g., lab values, vital signs).
Example:
```python
import pandas as pd
# Load your data
df = pd.read_excel('path/to/your/375_patients_example.xlsx')
# Sort by patient ID and timestamp
df.sort_values(by=['PATIENT_ID', 'RE_DATE'], inplace=True)
```
### **2. Initialize the Toolkit**
```python
import mtslearn.feature_extraction as fe
# Initialize the feature extraction and evaluation tool
fe = fe.FeModEvaluator(
df=df,
group_col='PATIENT_ID',
time_col='RE_DATE',
outcome_col='outcome',
features_to_extract={
'eGFR': ['mean', 'max'],
'creatinine': ['mean']
},
include_duration=True
)
```
### **3. Run the Analysis Pipeline**
```python
# Run the pipeline with XGBoost
fe.run(
model_type='xgboost',
fill=True,
fill_method='mean',
test_size=0.3,
balance_data=True
)
```
### **4. Visualize Results**
```python
# Boxplot for a specific clinical measurement
fe.describe_data(plot_type='boxplot', value_col='eGFR')
# Correlation matrix between two clinical measurements
fe.describe_data(plot_type='correlation_matrix', feature1='eGFR', feature2='creatinine')
```
## **Documentation**
For detailed documentation, including advanced usage, customization options, and examples, refer to the [User Guide](./User Guide.md).
## **License**
This project is licensed under the MIT License. See the [LICENSE](mtslearn-dev/LICENSE) file for details.
## **Contact**
For any questions or issues, please open an issue on GitHub or contact us at zycwalker11@gmail.com.
Raw data
{
"_id": null,
"home_page": "https://github.com/WalkerZYC/mtslearn",
"name": "mtslearn",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Walker ZYC",
"author_email": "Walker ZYC <zycwalker11@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/3d/f7/44fa809a6771dd9e00e7e18cf11a95e3b09f81c2be75e7c103cb8cc70c65/mtslearn-0.0.1.tar.gz",
"platform": null,
"description": "# **Medical Irregular Time-Series Data Analysis Toolkit**\n## **Overview**\n\nThe Medical Time-Series Data Analysis Toolkit `mtslearn` is designed to empower healthcare professionals and researchers with tools to analyze and interpret time-series medical data. It offers a comprehensive set of features for extracting key clinical metrics, preparing data for modeling, evaluating predictive models, and visualizing the results. The toolkit is specifically tailored to handle complex datasets, such as longitudinal irregular sampled patient records, and provides meaningful insights to support informed clinical decision-making.\n\n## **Features**\n\n- **Feature Extraction**: Automatically extract meaningful features from time-series data, including statistical measures and temporal dynamics.\n- **Data Preparation**: Handle missing data, balance datasets, and split data into training and testing sets with ease.\n- **Model Evaluation**: Supports multiple model types (Logistic Regression, Cox Proportional Hazards, XGBoost, Lasso) and evaluates model performance with key metrics.\n- **Visualization**: Generate visualizations such as boxplots and correlation matrices to help interpret clinical data and model outcomes.\n## **Installation**\n### **Clone the Repository**\nTo download and use the toolkit from GitHub, start by cloning the repository:\n```\ngit clone https://github.com/WalkerZYC/mtslearn.git\ncd mtslearn\n```\n### **Install Dependencies**\nNext, install the required dependencies:\n```\npip install -r requirements.txt\n```\nAlternatively, you can manually install the necessary Python packages:\n```\npip install pandas numpy scikit-learn matplotlib seaborn xgboost lifelines imbalanced-learn\n```\n## **Quickstart**\n### **1. Prepare Your Data**\nEnsure your data is in a pandas DataFrame with the following structure:\n\n- `Patient_ID`: Unique identifier for each patient.\n- `Record_Time`: Timestamp of the record.\n- `Outcome`: Outcome variable, indicating the result of treatment or condition.\n- `Clinical Measurements`: Relevant clinical data (e.g., lab values, vital signs).\n\nExample:\n```python\nimport pandas as pd\n\n# Load your data\ndf = pd.read_excel('path/to/your/375_patients_example.xlsx')\n\n# Sort by patient ID and timestamp\ndf.sort_values(by=['PATIENT_ID', 'RE_DATE'], inplace=True)\n```\n### **2. Initialize the Toolkit**\n```python\nimport mtslearn.feature_extraction as fe\n\n# Initialize the feature extraction and evaluation tool\nfe = fe.FeModEvaluator(\n df=df,\n group_col='PATIENT_ID',\n time_col='RE_DATE',\n outcome_col='outcome',\n features_to_extract={\n 'eGFR': ['mean', 'max'],\n 'creatinine': ['mean']\n },\n include_duration=True\n)\n```\n### **3. Run the Analysis Pipeline**\n```python\n# Run the pipeline with XGBoost\nfe.run(\n model_type='xgboost',\n fill=True,\n fill_method='mean',\n test_size=0.3,\n balance_data=True\n)\n```\n### **4. Visualize Results**\n```python\n# Boxplot for a specific clinical measurement\nfe.describe_data(plot_type='boxplot', value_col='eGFR')\n\n# Correlation matrix between two clinical measurements\nfe.describe_data(plot_type='correlation_matrix', feature1='eGFR', feature2='creatinine')\n```\n## **Documentation**\nFor detailed documentation, including advanced usage, customization options, and examples, refer to the [User Guide](./User Guide.md).\n## **License**\nThis project is licensed under the MIT License. See the [LICENSE](mtslearn-dev/LICENSE) file for details.\n## **Contact**\nFor any questions or issues, please open an issue on GitHub or contact us at zycwalker11@gmail.com.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python Package for ML using Irregularly Sampled Medical Time Series Data",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/WalkerZYC/mtslearn"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "49194b376e850d8ae1b959c6418ab15d5d42d3ec7f6bf6d5b3423cee08fa397b",
"md5": "a2475e3a30fa9366eb6550c13275659d",
"sha256": "503f7bad61073cec927a4ab2bdf12ac4f4df3babbc4a003471a8e751e18f1258"
},
"downloads": -1,
"filename": "mtslearn-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a2475e3a30fa9366eb6550c13275659d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 9334,
"upload_time": "2024-09-05T13:18:56",
"upload_time_iso_8601": "2024-09-05T13:18:56.150071Z",
"url": "https://files.pythonhosted.org/packages/49/19/4b376e850d8ae1b959c6418ab15d5d42d3ec7f6bf6d5b3423cee08fa397b/mtslearn-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3df744fa809a6771dd9e00e7e18cf11a95e3b09f81c2be75e7c103cb8cc70c65",
"md5": "ce654d894ff048e20ac95ed2195d1100",
"sha256": "dd785a0ff6d22e8db8b60d9a199801f500b27e1b95205aeb1caf668c178f1d80"
},
"downloads": -1,
"filename": "mtslearn-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "ce654d894ff048e20ac95ed2195d1100",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 11255,
"upload_time": "2024-09-05T13:18:57",
"upload_time_iso_8601": "2024-09-05T13:18:57.744526Z",
"url": "https://files.pythonhosted.org/packages/3d/f7/44fa809a6771dd9e00e7e18cf11a95e3b09f81c2be75e7c103cb8cc70c65/mtslearn-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-05 13:18:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "WalkerZYC",
"github_project": "mtslearn",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mtslearn"
}