How egemenozen1/pytorch-forecasting-tft works
Main Components
• Data Layer – Represent the raw dataset (data/AirQualityUCI.csv and .xlsx) as the data source. Include preprocessing steps (missing value handling, feature scaling, and train–test splitting) as a subcomponent.
• Experimentation & Notebooks – Represent the notebooks folder where experiments, data exploration, and analysis are executed. Note that there is extensive use of Jupyter notebooks for analysis and logging (with several lightning_logs directories to manage different model training versions).
• Model Training / PyTorch Lightning – Show the use of PyTorch Lightning for orchestrating model training. This is evident from the lightning logs in both the notebooks and src directories. Distinguish between the training pipeline (data feeding, model iteration, logging checkpoints, and hyperparameter tuning) and the core model, which in this case is the TFT.
• Inference & Evaluation Module – Illustrate how model inference is performed using a pre-trained TFT model (the saved weights like tft_final_model.pth are noted in the model_results folder). Include evaluation metrics such as MAE, MSE, RMSE along with visualizations (plots like scatter and histogram provided in the README).
• Source Code – Indicate the python scripts located in the src directory for setting up the environment and running analysis. These scripts encapsulate business logic for training and evaluating the model.
Relationships & Data Flow
• Data Flow: Begin with the data ingestion from the “data” folder → Preprocessing steps → input pipeline feeding experiments in the notebooks and scripts.
• Training Flow: Preprocessed data is then piped into the PyTorch Lightning model training workflow, which uses the TFT model architecture. The training process utilizes logging checkpoints and versioning (as evidenced by multiple “version_x” directories).
• Result Flow: After training, the results (predictions, error metrics, and visualizations) are generated. They are stored in notebooks/model_results, with the final evaluations feeding back into assessments for future improvements.
• Feedback Loop: Optionally, illustrate areas where planned improvements (hyperparameter tuning, additional feature engineering) feed back into the data preprocessing and model training iterations.