A versatile toolkit for analyzing, preprocessing, and modeling time-series data. This framework provides tools for data scaling, filtering, sequence generation, and training various LSTM models, including both standard and TimeDistributed approaches.
- Comprehensive Data Processing: Scale, filter, and prepare time-series data for supervised learning.
- Flexible Model Architectures: Choose between standard and
TimeDistributedLSTM models, with advanced configurations including attention mechanisms and residual connections. - Batch Data Generation: Efficiently load data in batches for large datasets to optimize memory usage.
- Model Training and Evaluation: Use built-in training configurations with callbacks for early stopping, learning rate reduction, and model checkpointing.
dataset.py: Contains theDatasetclass for data preprocessing, scaling, and sequence generation for model training.data_generator.py: Manages data batching, enabling efficient loading for large time-series datasets.LSTMRegressor.py: Implements various LSTM models, including both standard andTimeDistributedarchitectures.model.py: Defines theModelTrainerclass, which supports early stopping, model checkpointing, and learning rate adjustments.eval_model.py: Provides evaluation functions to assess model performance, including metrics such as MAE and Pearson’s correlation.
Install the required packages by running:
pip install -r requirements.txtTo organize saved models, scalers, and data files, follow this folder structure:
TimeSeriesModelingToolkit/
├── dataset.py
├── data_generator.py
├── LSTMRegressor.py
├── model.py
├── eval_model.py
├── saved_model/
├── scalers/
└── data/
To integrate TSMT into your project, clone the repository into your project directory:
git clone git@github.com:mikjkd/TSMT.git TSMTOrganize your project directory as follows:
forecast_project/
├── main.py
├── TSMT/
├── data/
├── saved_model/
├── scalers/
└── encoders/
Install the required packages by running:
pip install -r TSMT/requirements.txt- Place your data in the
data/folder. - Write the
main.pyfollowing themain_example.txt - Configure
main.pywith your dataset and desired settings. - Run the training script:
python main.py-
Evaluation: After training,
main.pywill save evaluation metrics and generate visualizations. Theeval_model.pyscript allows customization of evaluation metrics. -
Model Customization:
LSTMRegressor.pyprovides different LSTM configurations, including both standard and TimeDistributed options with advanced features like attention.
- Experiment with different attention mechanisms for improved accuracy.
- Extend model options with additional sequence models (e.g., GRU, Transformer).
- Explore hyperparameter tuning for dataset-specific performance optimization.