[PYTHON] Continue to make stock price forecast AI for 10 hours a day 3rd month

Previous previous article: 1st month Last article: 2nd month

3rd month

By the second month I had faced quite a few problems. There seems to be a limit to maximizing the prediction accuracy of one AI. So, I came up with a method that might be able to improve the prediction accuracy further, so I will write it here.

AI majority theory

The method is simple, first make some good AIs, preferably an odd number of AIs. After that, the AI collected will take a majority vote and make the final decision. In the first place, there is an aspect that the prediction is decided by majority vote in many cases even in one AI, and it is doubtful whether it is effective to actually collect multiple AIs and make them judge, but let's do it anyway. The problem is that the AI collected will probably need to be diverse, plus a certain number. This month's goal was to create some high-performance predictive AI using various data.

Problems in learning

There are two problems in training the data. One is overfitting and the other is prediction bias. For example, if you define 0 to go up and 1 to go down, the problem of outputting many 0s (0s occupy 70 to 100% of all predictions) frequently occurred in the previous models. The difficulty with these problems is that trying to solve the problem of overfitting creates a biased prediction, and vice versa. The following three variables were mainly involved in this problem: 1. The strength of the Normalization Layers settings and the number of layers. 2. Number of epochs. 3. Select Optimizer In addition to the learning process, the factors that affect the results are 4. Data structure and quality. And 5. the structure of the model.

About AI research

On rare occasions you can accidentally discover a good combination of the above variables and result in a good or very good AI. Deep learning is not just about learning data, but it requires various adjustments and trial and error in the process, and I realized that there is room for research and improvement on the library side that creates AI. I have made 3 types of AI so far, but the performance of the 2nd and 3rd AI is outstanding compared to the 1st AI, and I am considering expulsing the 1st AI from Congress. AI_No.2 image.png

This is the performance of the second AI I made. It has a prediction accuracy of 65.6% for all stock price data (43707 pieces) from 2000 of 500 major American companies, and the output ratio of 0 (forecast that the stock price will rise) is 57%, which is a particular problem. There is none. And the accuracy expected when the prediction is completely random is 51.56%, which suggests that the prediction is quite powerful.

Plan from now on

If there are three, the majority vote will be established, so I will write a code for verification in the actual stock market.

Recommended Posts

Continue to make stock price forecast AI for 10 hours a day 3rd month
Continue to make stock price forecast AI for 10 hours a day 2nd month 2nd week
4th month to continue making stock price forecast AI for 10 hours a day
How to make a model for object detection using YOLO in 3 hours
I tried to make a face diagnosis AI for a female professional golfer ①
I tried to make a face diagnosis AI for a female professional golfer ②
I posted a UNIQLO (Fast Retailing) stock price forecast dataset to Kaggle
I tried to make AI for Smash Bros.
Stock Price Forecast 1 Chapter 1
Continue to make stock price forecast AI for 10 hours a day 3rd month
Continue to make stock price forecast AI for 10 hours a day 2nd month 2nd week
4th month to continue making stock price forecast AI for 10 hours a day
How to make a model for object detection using YOLO in 3 hours
I tried to make a face diagnosis AI for a female professional golfer ①
I tried to make a face diagnosis AI for a female professional golfer ②
I posted a UNIQLO (Fast Retailing) stock price forecast dataset to Kaggle
Introduction to discord.py (1st day) -Preparation for discord.py-
I tried to make AI for Smash Bros.
Stock Price Forecast 2 Chapter 2
Stock Price Forecast 1 Chapter 1
[Introduction to Systre] Stock price forecast; Monday is weak m (__) m
How to make a Python package (written for an intern)
[Introduction to Systre] Stock price forecast; Monday is weak m (__) m
How to make a Python package (written for an intern)