# InterpreTS - Overview
**interpreTS** is a Python library designed for extracting meaningful and interpretable features from time series data to support the creation of interpretable and explainable predictive models.
## Key Features
- **Feature Extraction**: Extract features such as mean, variance, spikeness, entropy, trend strength, and more.
- **Interpretable Models**: Generate explainable predictive models by leveraging extracted features.
- **Streaming Data Support**: Process and extract features in real-time from streaming data sources.
- **Scalability**: Supports parallel and distributed computation with `joblib` and `dask`.
- **Custom Features**: Extend the library with user-defined features.
- **Validation**: Ensures input data meets the required format and quality using built-in validators.
## Requirements
- Python 3.10 or above
- `pandas==2.2.3`
- `numpy`
- `statsmodels==0.14.4`
- `langchain_community==0.3.14`
- `langchain==0.3.14`
- `openai==1.59.4`
- `streamlit==1.41.1`
- `scikit-learn`
- `joblib==1.4.2`
- `tqdm==4.67.1`
- `dask==2024.12.1`
- `scipy==1.15.0`
- `pillow==11.1.0`
## Installation Guide
Follow these steps to install InterpreTS and its dependencies:
### From PyPI
```bash
pip install interpreTS
```
### From Source
1. Clone the repository:
```bash
git clone https://github.com/yourusername/interpreTS.git
cd interpreTS
```
2. Install dependencies: Install the required packages listed in the `requirements.txt` file:
```bash
pip install -r requirements.txt
```
3. Install InterpreTS: Run the following command to install InterpreTS:
```bash
pip install .
```
## GUI
InterpreTS offers a user-friendly GUI to facilitate time series feature extraction and model explainability.
### Accessing the GUI
The GUI is hosted online and available at [InterpreTS GUI](https://ruleminer-interprets-interpretscoreguigui-streamlit-gui--zcpuxp.streamlit.app/).
Alternatively, you can run it locally:
1. Navigate to the GUI directory:
```bash
cd interpreTS/core/gui
```
2. Launch the GUI using Streamlit:
```bash
streamlit run gui.py
```
### Features of the GUI
* Feature Extraction: Easily upload time series data and extract predefined or custom features.
* Visualization: View extracted features directly in the GUI.
## Verifying Installation - Example: Basic Feature Extraction
Once installed, you can verify the installation by running a simple feature extraction example:
```python
import pandas as pd
from interpreTS import FeatureExtractor, Features
# Sample time series data
data = pd.DataFrame({
"time": pd.date_range("2023-01-01", periods=10, freq="D"),
"value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
})
# Initialize the FeatureExtractor
extractor = FeatureExtractor(features=[Features.MEAN, Features.VARIANCE], feature_column="value")
# Extract features
features_df = extractor.extract_features(data)
print(features_df)
```
## Additional Usage Example with Time Series Data
```python
import pandas as pd
import numpy as np
import time
from interpreTS import FeatureExtractor, Features
def report_progress(progress):
print(f"Progress: {progress}%", flush=True)
# Generate synthetic time series data
data = pd.DataFrame({
'id': np.repeat(range(100), 100),
'time': np.tile(range(100), 100),
'value': np.random.randn(10000)
})
# Initialize the FeatureExtractor
feature_extractor = FeatureExtractor(
features=[Features.ENTROPY],
feature_column="value",
id_column="id",
window_size=5, # Rolling window size
stride=2 # Step size for moving the window
)
# Measure execution time
start_time = time.time()
# Extract features
features_df = feature_extractor.extract_features(data, progress_callback=report_progress, mode='sequential')
end_time = time.time()
# Display results and execution time
print(features_df.head()) # Display the first few rows of the resulting DataFrame
print(f"Execution time: {end_time - start_time:.2f} seconds")
```
## Documentation
Complete documentation is available on [GitHub Pages](https://ruleminer.github.io/InterpreTS/).
## Issues and Support
For any issues, please consult our [Issue Tracker](https://github.com/ruleminer/InterpreTS/issues) on GitHub.
Raw data
{
"_id": null,
"home_page": "https://github.com/ruleminer/InterpreTS",
"name": "InterpreTS",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "time series feature extraction interpretability explainability machine learning",
"author": "['S\u0142awomir Put', 'Martyna \u017bur', 'Weronika Wo\u0142owczyk', 'Jaros\u0142aw Strzelczyk', 'Piotr Krupi\u0144ski', 'Martyna Kramarz', '\u0141ukasz Wr\u00f3bel']",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ac/0a/a7b8d54e0f80a3da00cb3a377cf427f315eea8236284a11802aa51f345f1/InterpreTS-0.5.0.tar.gz",
"platform": null,
"description": "# InterpreTS - Overview \r\n\r\n **interpreTS** is a Python library designed for extracting meaningful and interpretable features from time series data to support the creation of interpretable and explainable predictive models.\r\n\r\n## Key Features\r\n - **Feature Extraction**: Extract features such as mean, variance, spikeness, entropy, trend strength, and more.\r\n - **Interpretable Models**: Generate explainable predictive models by leveraging extracted features.\r\n - **Streaming Data Support**: Process and extract features in real-time from streaming data sources.\r\n - **Scalability**: Supports parallel and distributed computation with `joblib` and `dask`.\r\n - **Custom Features**: Extend the library with user-defined features.\r\n - **Validation**: Ensures input data meets the required format and quality using built-in validators.\r\n\r\n## Requirements\r\n - Python 3.10 or above\r\n - `pandas==2.2.3`\r\n - `numpy`\r\n - `statsmodels==0.14.4`\r\n - `langchain_community==0.3.14`\r\n - `langchain==0.3.14`\r\n - `openai==1.59.4`\r\n - `streamlit==1.41.1`\r\n - `scikit-learn`\r\n - `joblib==1.4.2`\r\n - `tqdm==4.67.1`\r\n - `dask==2024.12.1`\r\n - `scipy==1.15.0`\r\n - `pillow==11.1.0`\r\n\r\n## Installation Guide\r\n Follow these steps to install InterpreTS and its dependencies:\r\n\r\n### From PyPI\r\n \r\n ```bash\r\npip install interpreTS\r\n ```\r\n\r\n### From Source\r\n1. Clone the repository:\r\n ```bash\r\ngit clone https://github.com/yourusername/interpreTS.git\r\ncd interpreTS\r\n ```\r\n\r\n2. Install dependencies: Install the required packages listed in the `requirements.txt` file:\r\n\r\n ```bash\r\npip install -r requirements.txt\r\n ```\r\n\r\n3. Install InterpreTS: Run the following command to install InterpreTS:\r\n\r\n ```bash\r\npip install .\r\n ```\r\n\r\n## GUI\r\nInterpreTS offers a user-friendly GUI to facilitate time series feature extraction and model explainability.\r\n\r\n### Accessing the GUI\r\nThe GUI is hosted online and available at [InterpreTS GUI](https://ruleminer-interprets-interpretscoreguigui-streamlit-gui--zcpuxp.streamlit.app/). \r\n\r\nAlternatively, you can run it locally:\r\n1. Navigate to the GUI directory:\r\n ```bash\r\ncd interpreTS/core/gui\r\n ```\r\n\r\n2. Launch the GUI using Streamlit:\r\n ```bash\r\nstreamlit run gui.py\r\n ```\r\n\r\n### Features of the GUI\r\n* Feature Extraction: Easily upload time series data and extract predefined or custom features.\r\n* Visualization: View extracted features directly in the GUI.\r\n\r\n## Verifying Installation - Example: Basic Feature Extraction\r\n Once installed, you can verify the installation by running a simple feature extraction example:\r\n\r\n ```python\r\n\r\nimport pandas as pd\r\nfrom interpreTS import FeatureExtractor, Features\r\n\r\n# Sample time series data\r\ndata = pd.DataFrame({\r\n\"time\": pd.date_range(\"2023-01-01\", periods=10, freq=\"D\"),\r\n\"value\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\r\n})\r\n\r\n# Initialize the FeatureExtractor\r\nextractor = FeatureExtractor(features=[Features.MEAN, Features.VARIANCE], feature_column=\"value\")\r\n\r\n# Extract features\r\nfeatures_df = extractor.extract_features(data)\r\nprint(features_df)\r\n\r\n ```\r\n\r\n## Additional Usage Example with Time Series Data\r\n\r\n ```python\r\nimport pandas as pd\r\nimport numpy as np\r\nimport time\r\nfrom interpreTS import FeatureExtractor, Features\r\n\r\ndef report_progress(progress):\r\n print(f\"Progress: {progress}%\", flush=True)\r\n\r\n# Generate synthetic time series data\r\ndata = pd.DataFrame({\r\n'id': np.repeat(range(100), 100), \r\n'time': np.tile(range(100), 100), \r\n'value': np.random.randn(10000) \r\n})\r\n\r\n# Initialize the FeatureExtractor\r\nfeature_extractor = FeatureExtractor(\r\nfeatures=[Features.ENTROPY],\r\nfeature_column=\"value\",\r\nid_column=\"id\",\r\nwindow_size=5, # Rolling window size\r\nstride=2 # Step size for moving the window\r\n)\r\n\r\n# Measure execution time\r\nstart_time = time.time()\r\n\r\n# Extract features\r\nfeatures_df = feature_extractor.extract_features(data, progress_callback=report_progress, mode='sequential')\r\n\r\nend_time = time.time()\r\n\r\n# Display results and execution time\r\nprint(features_df.head()) # Display the first few rows of the resulting DataFrame\r\nprint(f\"Execution time: {end_time - start_time:.2f} seconds\")\r\n\r\n ```\r\n\r\n## Documentation\r\n\r\nComplete documentation is available on [GitHub Pages](https://ruleminer.github.io/InterpreTS/).\r\n\r\n\r\n## Issues and Support\r\n\r\nFor any issues, please consult our [Issue Tracker](https://github.com/ruleminer/InterpreTS/issues) on GitHub.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Feature extraction from time series to support the creation of interpretable and explainable predictive models.",
"version": "0.5.0",
"project_urls": {
"Documentation": "https://github.com/ruleminer/InterpreTS/docs",
"Homepage": "https://github.com/ruleminer/InterpreTS",
"Source": "https://github.com/ruleminer/InterpreTS",
"Tracker": "https://github.com/ruleminer/InterpreTS/issues"
},
"split_keywords": [
"time",
"series",
"feature",
"extraction",
"interpretability",
"explainability",
"machine",
"learning"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "102f8abc3f65eac5217b95e36d7583f0799d82868efdc4a2b272aca978d0ee46",
"md5": "c5c09006f32ceade4f6b090490037e2f",
"sha256": "7f339c00ca41d78693627d97dc55422700c7042c80764c9c3a39fad3b45776db"
},
"downloads": -1,
"filename": "InterpreTS-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c5c09006f32ceade4f6b090490037e2f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 97734,
"upload_time": "2025-01-08T03:48:28",
"upload_time_iso_8601": "2025-01-08T03:48:28.088803Z",
"url": "https://files.pythonhosted.org/packages/10/2f/8abc3f65eac5217b95e36d7583f0799d82868efdc4a2b272aca978d0ee46/InterpreTS-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ac0aa7b8d54e0f80a3da00cb3a377cf427f315eea8236284a11802aa51f345f1",
"md5": "2772318b4022d1535c355a4737b32a8d",
"sha256": "7e7daad59c3522a0e1266c91f26b258dd30e82d4f666052f5a20512cc5eb8a8d"
},
"downloads": -1,
"filename": "InterpreTS-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "2772318b4022d1535c355a4737b32a8d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 49797,
"upload_time": "2025-01-08T03:48:29",
"upload_time_iso_8601": "2025-01-08T03:48:29.851323Z",
"url": "https://files.pythonhosted.org/packages/ac/0a/a7b8d54e0f80a3da00cb3a377cf427f315eea8236284a11802aa51f345f1/InterpreTS-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-08 03:48:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ruleminer",
"github_project": "InterpreTS",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pandas",
"specs": [
[
"==",
"2.2.3"
]
]
},
{
"name": "numpy",
"specs": []
},
{
"name": "statsmodels",
"specs": [
[
"==",
"0.14.4"
]
]
},
{
"name": "langchain_community",
"specs": [
[
"==",
"0.3.14"
]
]
},
{
"name": "langchain",
"specs": [
[
"==",
"0.3.14"
]
]
},
{
"name": "openai",
"specs": [
[
"==",
"1.59.4"
]
]
},
{
"name": "streamlit",
"specs": [
[
"==",
"1.41.1"
]
]
},
{
"name": "scikit-learn",
"specs": []
},
{
"name": "joblib",
"specs": [
[
"==",
"1.4.2"
]
]
},
{
"name": "tqdm",
"specs": [
[
"==",
"4.67.1"
]
]
},
{
"name": "dask",
"specs": [
[
"==",
"2024.12.1"
]
]
},
{
"name": "scipy",
"specs": [
[
"==",
"1.15.0"
]
]
},
{
"name": "pillow",
"specs": [
[
"==",
"11.1.0"
]
]
}
],
"lcname": "interprets"
}