Skip to content

cyber-yosh/Stock-Trader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Project EPJ 📈

Stock Price Prediction using Temporal Fusion Transformer

Screenshot 2025-02-28 at 8 31 28 AM

Overview

Project EPJ uses advanced deep learning techniques to predict stock prices with high accuracy. By leveraging the Temporal Fusion Transformer (TFT) architecture, this project captures complex temporal patterns in financial time series data.

Features

  • Multi-horizon Forecasting: Predict stock prices across multiple future time steps
  • Interpretable Predictions: Understand which features drive the model's decisions
  • Attention Mechanisms: Capture long-range dependencies in financial data
  • Variable Selection Networks: Automatically identify the most relevant features
  • Quantile Forecasting: Estimate prediction uncertainty for risk management

Getting Started

Prerequisites

  • Python 3.7+
  • PyTorch
  • PyTorch Forecasting
  • pandas
  • numpy
  • matplotlib

Installation

git clone https://github.com/yourusername/project-epj.git
cd project-epj
pip install -r requirements.txt

Quick Start

# Example code to load model and make predictions
from model import TemporalFusionTransformer
import pandas as pd

# Load your pre-trained model
model = TemporalFusionTransformer.load("models/tft_stock_model.pth")

# Prepare your data
data = pd.read_csv("data/stock_data.csv")

# Make predictions
predictions = model.predict(data)

Model Architecture

The Temporal Fusion Transformer combines:

  • LSTM encoders for processing sequential data
  • Self-attention layers for capturing long-range dependencies
  • Variable selection networks for handling multivariate data
  • Quantile outputs for uncertainty estimation

Results

Our model achieves:

  • MAPE: 1.2% on test data
  • RMSE: 0.45 on 5-day forecasts
  • Outperforms ARIMA and LSTM baselines by 15%

Google Colab Notebook

Explore the complete implementation in our Google Colab notebook.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

cool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages