Time-series-prediction Project Introduction
Time-series-prediction, also known as TFTS (TensorFlow Time Series), is an advanced and user-friendly package designed for time series forecasting tasks. This project harnesses the power of TensorFlow and Keras to provide support for both traditional and cutting-edge deep learning methods. It aims to deliver state-of-the-art performance in various time series scenarios, including prediction, classification, and anomaly detection.
Key Features
- Comprehensive Support: TFTS supports a wide array of time series tasks, making it versatile for industries, researchers, and competitive environments.
- Advanced Models: It incorporates advanced deep learning models, playing a crucial role in achieving high performance.
- Documentation and Community: Users can find detailed documentation and tutorials online, ensuring they can effectively utilize the tools provided by TFTS.
Installation and Requirements
To get started with the TFTS package, users need Python version 3.7 or higher and TensorFlow version 2.4 or above. Installation can be done easily via pip with the following command:
pip install tfts
Quick Start Guide
The package offers a simple way to dive into time series prediction:
- Data Preparation: Generate sample data using built-in methods or input your own dataset.
- Model Configuration: Choose a model, such as
seq2seq
, and configure it using AutoConfig. - Model Training: Use KerasTrainer to train your model with the available data.
- Prediction and Visualization: Generate predictions and visualize results with the built-in plotting functions.
Here is a sample code snippet for a quick start:
import matplotlib.pyplot as plt
import tfts
from tfts import AutoModel, AutoConfig, KerasTrainer
train_length = 24
predict_length = 8
(x_train, y_train), (x_valid, y_valid) = tfts.get_data("sine", train_length, predict_length, test_size=0.2)
model_name_or_path = 'seq2seq'
config = AutoConfig.for_model(model_name_or_path)
model = AutoModel.from_config(config, predict_length=predict_length)
trainer = KerasTrainer(model)
trainer.train((x_train, y_train), (x_valid, y_valid), n_epochs=3)
pred = trainer.predict(x_valid)
trainer.plot(history=x_valid, true=y_valid, pred=pred)
plt.show()
Data Handling Options
The TFTS package supports both encoder-only and encoder-decoder model inputs, and it can handle data inputs in np.ndarray
and tf.data.Dataset
formats, making it flexible for different data processing workflows.
Custom Configurations and Model Building
Users can customize their models by defining specific configurations, such as modifying the architecture or adding custom layers. TFTS provides a list of supported model architectures including RNN, TCN, BERT, N-Beats, Seq2Seq, WaveNet, Transformer, Informer, and more, allowing for extensive experimentation and optimization.
Achievements and Recognition
TFTS has been successfully used in competitive scenarios, such as achieving third place in the KDD Cup 2022 for wind power forecasting and fourth place in the Tianchi-ENSO prediction challenge in 2021.
Alternatives
For users interested in exploring similar functionalities in different deep learning frameworks, they can consider other projects like Pytorch-forecasting, GluonTS, and PaddleTS.
Citing the Project
Users who leverage the TFTS project for research or publication purposes are encouraged to cite the project using the provided citation format. This recognition helps in further development and maintenance of the project.
Time-series-prediction, with its comprehensive features and community support, stands out as a valuable tool for tackling complex time series challenges efficiently.