Git Product home page Git Product logo

meip's Introduction

MEIP

Multivariate approach towards embedding and inference of ticker performance


Example

AAPL prediction, YTD as of 2023-05-04. To reproduce, run: --infer "embedding=169.27999877929688,169.58999633789062,52472900,0.0018312710351440706,0.28674579694725333,-0.4767 days=365"


Research

Abstract

The goal of this project is to explore and demonstrate a PoC of an approach to predicting ticker embeddings, as opposed to traditional time-series analysis which relies on single-values (generally day closes). Similar to NLP embeddings, ticker embeddings as explored in this project are a numerical representation of a ticker's metadata. This metadata includes, but is not limited to, sentiment, open, close, volatility, etc. The embeddings are then used to infer the performance of a ticker based on the performance of similar tickers.

Models

A multi-model approach is taken towards the embedding and inference of ticker performance. For sentiment analysis over time in particular, the NLTK Vader model is used. Ticker embeddings, in contrast to traditional word embeddings, are a numerical complitation of the ticker metadata. From there, a K Nearest Neighbors model is used to find the most similar tickers to a given ticker. This process closely mirrors vector-based search in NLP.


Usage

While this repository is intended to be a simple PoC, it is also intended to be a template for future projects. As such, the project is structured in a way that allows for easy extension and modification. A Google Colab notebook is provided for ease of use here.

For those who wish to run the project locally, the following steps are recommended:

  1. Clone the repository git clone https://github.com/finned-tech/MEIP.git
  2. cd into the repository cd MEIP
  3. Install the dependencies pip install -r requirements.txt
  4. Run the project python main.py

There are a few arguments that can be passed to the main script in order to process, train, and predict with the model locally. These arguments are as follows:

  • --process: Process the data
  • --train: Train the model
  • --make-embedding "": Make an embedding for a given ticker, intended to be passed to the --infer argument, where headline is the news headline to be embedded, ticker is the ticker to be embedded, and date is the date of the headline's publish.
    Example: --make-embedding "headline='<headline>' ticker=SPY date=<YYYY-MM-DD>"
  • --infer: Infer the performance of a ticker based on the performance of similar tickers, over a specified period (in days). Note that you don't need to pass the ticker in this step: All the necessary information is encoded in the embedding.
    Example: --infer "embedding=169.27999877929688,169.58999633789062,52472900,0.0018312710351440706,0.28674579694725333,-0.4767 days=365". The output will be saved to infer.png.

Configuration

The configuration file is located at model/hyperparams.py. This file contains all of the modifiable hyperparameters for the model.

meip's People

Contributors

flancast90 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.