FinGAT: A Financial Graph Attention Networkto Recommend Top-K Profitable Stocks

Overview

FinGAT: A Financial Graph Attention Networkto Recommend Top-K Profitable Stocks

This is our implementation for the paper:

FinGAT: A Financial Graph Attention Networkto Recommend Top-K Profitable Stocks

Under review of TKDE

Requirements

  • pytorch==1.0.0
  • numpy==1.16.4
  • pandas==0.25.3

Model architecture

How to train the model

  1. Run clean_data.py This script would run the preprocessing for raw data and dump a preprocessed file.
  2. Run train.py you can tune the hyper parameters by adding args after train.py e.g. python3 train.py --epoch 10 --l2 1e-6 etc.
--epoch: number of epochs
--l2: l2 regularization
--dim: dimension for hidden layer
--alpha: The adaptive weight on MAE loss
--beta: The adaptive weight on classification loss
--gamma: The adaptive weight on ranking loss
--lr: learning rate
--device: The device name for training, if train with cpu please use:"cpu"

Reslut

You might also like...
A resource for learning about deep learning techniques from regression to LSTM and Reinforcement Learning using financial data and the fitness functions of algorithmic trading

A tour through tensorflow with financial data I present several models ranging in complexity from simple regression to LSTM and policy networks. The s

PGPortfolio: Policy Gradient Portfolio, the source code of "A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem"(https://arxiv.org/pdf/1706.10059.pdf).

This is the original implementation of our paper, A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem (arXiv:1706.1

This project is a loose implementation of paper "Algorithmic Financial Trading with Deep Convolutional Neural Networks: Time Series to Image Conversion Approach"

Stock Market Buy/Sell/Hold prediction Using convolutional Neural Network This repo is an attempt to implement the research paper titled "Algorithmic F

Technical Indicators implemented in Python only using Numpy-Pandas as Magic  - Very Very Fast! Very tiny!  Stock Market Financial Technical Analysis Python library .  Quant Trading automation or cryptocoin exchange
Technical Indicators implemented in Python only using Numpy-Pandas as Magic - Very Very Fast! Very tiny! Stock Market Financial Technical Analysis Python library . Quant Trading automation or cryptocoin exchange

MyTT Technical Indicators implemented in Python only using Numpy-Pandas as Magic - Very Very Fast! to Stock Market Financial Technical Analysis Python

Implementation of Transformer in Transformer, pixel level attention paired with patch level attention for image classification, in Pytorch
Implementation of Transformer in Transformer, pixel level attention paired with patch level attention for image classification, in Pytorch

Transformer in Transformer Implementation of Transformer in Transformer, pixel level attention paired with patch level attention for image c

Implementation of the 😇 Attention layer from the paper, Scaling Local Self-Attention For Parameter Efficient Visual Backbones
Implementation of the 😇 Attention layer from the paper, Scaling Local Self-Attention For Parameter Efficient Visual Backbones

HaloNet - Pytorch Implementation of the Attention layer from the paper, Scaling Local Self-Attention For Parameter Efficient Visual Backbones. This re

Implementation of STAM (Space Time Attention Model), a pure and simple attention model that reaches SOTA for video classification
Implementation of STAM (Space Time Attention Model), a pure and simple attention model that reaches SOTA for video classification

STAM - Pytorch Implementation of STAM (Space Time Attention Model), yet another pure and simple SOTA attention model that bests all previous models in

PyTorch code for our paper "Attention in Attention Network for Image Super-Resolution"

Under construction... Attention in Attention Network for Image Super-Resolution (A2N) This repository is an PyTorch implementation of the paper "Atten

Attention-driven Robot Manipulation (ARM) which includes Q-attention
Attention-driven Robot Manipulation (ARM) which includes Q-attention

Attention-driven Robotic Manipulation (ARM) This codebase is home to: Q-attention: Enabling Efficient Learning for Vision-based Robotic Manipulation I

Comments
  • Hi, Can I get the raw data for these scripts

    Hi, Can I get the raw data for these scripts

    Trying to do a research based on the paper but I'm missing several files

    • SP500_category.csv
    • files under ./SP500_dataset/
    • ./Taiwan_inner_edge.npy
    • ./edge_10.npy
    • ./Taiwan_inner_edge20.npy
    • ./Taiwan_outer_edge.npy
    • Taiwan_model_data_10_best.pickle Can you possibly send me the files? If you don't want to open it to public, please send me via e-mail ([email protected])
    opened by michael960725 4
  • can we find the data and npy files? Thanks!

    can we find the data and npy files? Thanks!

    inner_edge = np.array(np.load("./Taiwan_inner_edge.npy")) inner10_edge = np.array(np.load("./edge_10.npy")) inner20_edge = np.array(np.load("./Taiwan_inner_edge20.npy")) outer_edge = np.array(np.load("./Taiwan_outer_edge.npy"))

    Would you like to share? Or we can discuss in private for mutual fund. I am the elder from NTU as well :D

    opened by ctstanleylee 1
  • FileNotFoundError: [Errno 2] No such file or directory: 'Taiwan_model_data_10_best.pickle'

    FileNotFoundError: [Errno 2] No such file or directory: 'Taiwan_model_data_10_best.pickle'

    Runnning this : python3 train.py --epoch 10 --l2 1e-6

    gives following error :

    Namespace(data='Taiwan_model_data_10_best.pickle', model='CAT', epochs=10, dual_attention=False, dim=16, l2=1e-06, lr=0.05, alpha=1, beta=1, gamma=1, device='cuda:1', use_gru=False, week_num=3, weight=0.5)
    Traceback (most recent call last):
      File "/home/hemang/Downloads/Financial-GraphAttention-master/train.py", line 22, in <module>
        with open(data_path,"rb") as f:
    FileNotFoundError: [Errno 2] No such file or directory: 'Taiwan_model_data_10_best.pickle'
    
    opened by hemangjoshi37a 0
Owner
Yu-Che Tsai
Major in Computer Science, Statistics and interested in machine learning, deep learning with it's application in rec sys, network analysis.
Yu-Che Tsai
[CVPR'21] Learning to Recommend Frame for Interactive Video Object Segmentation in the Wild

IVOS-W Paper Learning to Recommend Frame for Interactive Video Object Segmentation in the Wild Zhaoyun Yin, Jia Zheng, Weixin Luo, Shenhan Qian, Hanli

SVIP Lab 38 Dec 12, 2022
arxiv-sanity, but very lite, simply providing the core value proposition of the ability to tag arxiv papers of interest and have the program recommend similar papers.

arxiv-sanity, but very lite, simply providing the core value proposition of the ability to tag arxiv papers of interest and have the program recommend similar papers.

Andrej 671 Dec 31, 2022
Job-Recommend-Competition - Vectorwise Interpretable Attentions for Multimodal Tabular Data

SiD - Simple Deep Model Vectorwise Interpretable Attentions for Multimodal Tabul

Jungwoo Park 40 Dec 22, 2022
A PoC Corporation Relationship Knowledge Graph System on top of Nebula Graph.

Corp-Rel is a PoC of Corpartion Relationship Knowledge Graph System. It's built on top of the Open Source Graph Database: Nebula Graph with a dataset

Wey Gu 20 Dec 11, 2022
Use graph-based analysis to re-classify stocks and to improve Markowitz portfolio optimization

Dynamic Stock Industrial Classification Use graph-based analysis to re-classify stocks and experiment different re-classification methodologies to imp

Sheng Yang 10 Dec 5, 2022
An attempt at the implementation of Glom, Geoffrey Hinton's new idea that integrates neural fields, predictive coding, top-down-bottom-up, and attention (consensus between columns)

GLOM - Pytorch (wip) An attempt at the implementation of Glom, Geoffrey Hinton's new idea that integrates neural fields, predictive coding,

Phil Wang 173 Dec 14, 2022
Implementation of Bidirectional Recurrent Independent Mechanisms (Learning to Combine Top-Down and Bottom-Up Signals in Recurrent Neural Networks with Attention over Modules)

BRIMs Bidirectional Recurrent Independent Mechanisms Implementation of the paper Learning to Combine Top-Down and Bottom-Up Signals in Recurrent Neura

Sarthak Mittal 26 May 26, 2022
Use unsupervised and supervised learning to predict stocks

AIAlpha: Multilayer neural network architecture for stock return prediction This project is meant to be an advanced implementation of stacked neural n

Vivek Palaniappan 1.5k Dec 26, 2022
Use unsupervised and supervised learning to predict stocks

AIAlpha: Multilayer neural network architecture for stock return prediction This project is meant to be an advanced implementation of stacked neural n

Vivek Palaniappan 1.5k Jan 6, 2023
Experimental solutions to selected exercises from the book [Advances in Financial Machine Learning by Marcos Lopez De Prado]

Advances in Financial Machine Learning Exercises Experimental solutions to selected exercises from the book Advances in Financial Machine Learning by

Brian 1.4k Jan 4, 2023