This project is related to a computer science course Building AI at Helsinki University.
- Let me introduce StockBrain: a machine learning model that predicts the direction of a stock market based on ten previous days.
- Knowing where the stocks are going is an important skill for investors - both professionals and individuals - because it's the way they make money. This AI model helps with this problem by giving an idea of what is maybe going to happen next day, so that the user can find the best time to buy and sell shares.
- Some CC0 public domain licensed data was used to train this model. The original data set can be found here. The set contains about 690 MB of historical data about stock markets. In order to limit the number of input parameters, only the high and low data was being used to train the neural network.
- My model is most likely being used on investor's desktop by themself or by their automatised investing AI. It's important to make sure that the user understands the limits and weaknesses of this model. This should only be used as an extra advice.
- The phenomenon that this AI is built to model (stock market movement) is not always predictable and regular. Unexpected events - such as COVID-19 in March 2020 - may occur. The investors are always responsible of their money themselves.
- The AI could become better by taking account of more parameters and key values as well as longer-term changes in the stock price. The whole project could grow and reach attention by proving its capability in action.
- Dependencies can be found later in this Readme. The idea of this project is my own and all of the code (excluding dependencies) is written solely by me without forking etc.
Make sure that you have installed all of the required dependencies listed below. Also check your Python's version. Then run the ui.py
file.
Below is a table showing the libraries on which this project is directly depending. Please note that these libraries also have their own dependencies.
Name | License | Tested with version |
---|---|---|
joblib | BSD 3-Clause | 1.1.0 |
sklearn | BSD 3-Clause | 1.0.1 |
yfinance* | Apache License 2.0 | 0.1.68 |
*Yfinance offers an extra feature that allows user to input stock's symbol (e.g. "AAPL") instead of the price history manually. This makes the program much easier to use, but installation of this library is optional.
This project requires Python 3.7 or higher (built and tested on 3.9.9). Following libraries are being used from the standard library: os, random, csv, json.
As mentioned, CC0 licensed dataset was used to thain this model. The dataset is so big that I decided not to include the data in this reposity. If you need the dataset (e.g. to train the model further), place the Stocks
folder of the dataset into same folder with all of the python files of this reposity, and rename it to training-data
.
To read more about the process of making the AI model, see about-model.md.