Giter Club home page Giter Club logo

cocpc's Introduction

Copula-based Contrastive Prediction Coding (Co-CPC)

This repository releases the code and data for stock movement prediction by considering the coupling with macroeconomic indicators. Please cite the follow paper if you use this code.

G. Wang, L. Cao, et.al, Coupling Macro-Sector-Micro Financial Indicators for LearningStock Representations with Less Uncertainty, AAAI 2021.

Should you have any query please contact me at [email protected].

Dependencies

  • Python 3.6.9
  • Pytorch 1.0.0
  • Scipy 1.3.1

Directories

  • data: dataset consisting of ACL18 dataset, KDD17 dataset and some macroeconomic variables in varied time intervals.
  • log: store trained model for prediction. Our trained model for acl18 dataset (our_model-v1-model_best.pth) and kdd17 dataset (our_model-v_kdd17-model_best.pth) are provided.

Data Preprocess

Due to the upload limit, we just upload the smaller one preprocessed data in pickle format. For larger data, you can generate the data by running load_data.py file.

  • ACL18 (Stocknet Data): similar to the original paper, we generate each batch data with size 32. The preprocess operation can be refer to file load_data.py, here we provide the preprocessed file in pickle format.
  • KDD17: The raw data is from Adv-ALSTM, we process them in load_data.py file, here we also provide the prepprocessed file in pickle format.
  • Macroeconomic indicators: The data is from FRED.

Running

  • directly use pre-trained model for prediction:

    python main.py --version v1 --epochs 30

  • train Co-CPC model:

    python main.py --cpc_train True --version v1

cocpc's People

Contributors

goiter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.