Giter Site home page Giter Site logo

transformer_for_stockprediction's Introduction

Stock prediction by transformer

Launch

The created application can be used by starting it on a Docker container or by installing the library in the local environment.

Download:

git clone 
cd ./Transformer_for_StockPrediction

Docker

Build and run from dockerfile.

docker build -t stock_pred .
docker run -p 8501:8501 stock_pred

It is also possible to pull the docker image and build it. https://hub.docker.com/repository/docker/yusuke0614/stock_predict/general

docker pull yusuke0614/stock_predict:latest
docker run -p 8501:8501 yusuke0614/stock_predict

After executing the above command, access http:localhost:8501.

Local

Execute the following only when running in a virtual environment.

python venv venv
source ./source venv/bin/activate

Install the necessary libraries and start Streamlit. After startup, a URL will be displayed on the console, so access this URL. As for torch, installing the regular version is large, so install the lightweight version by specifying the URL.

pip install torch==2.1.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install -r requirement.txt
streamlit run main.py

Usage

Overview

By using the created model, you can predict stock prices.Stock price information is searched based on the stock and period conditions specified on the application, and the Transformer model is retrained based on the results.

The weights of the initial Transformer model are the result of training using stock prices of stocks listed on the TSE Prime Market up to the present (November 3, 2023). The list of stocks specifically used is as follows: ./data/Stock_List.csv.

Set the Parameter

You need to enter the stock code, stock price acquisition start date, and acquisition end date.

Stock codes are obtained from Yahoo Finance.

Once the input is complete, stock prices are obtained and displayed in tables and graphs.

Predict

Once the parameters have been entered, a predict button will appear below the graph, so click on it. When you press the button, learning is performed again based on the data displayed at the top of the screen, and the final results are displayed in a graph. The portions indicated by dotted lines are predicted values.

transformer_for_stockprediction's People

Contributors

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