当前位置:网站首页>Traditional machine learning classification model predicts the rise and fall of stock prices
Traditional machine learning classification model predicts the rise and fall of stock prices
2022-06-13 00:55:00 【Your name is Yu yuezheng】
Preface
The stock market is surging , Only a good forecast of the stock price can we better seize the profit opportunity . So what is the effect of the traditional machine learning classification model in this respect ?
This paper only considers 5、10、20 Daily moving average 、 Moving exponential average In the case of these six indicators , Comparison of the Support vector machine 、 Decision tree 、 Random forests Three models predict the effect of stock price fluctuation
Generally speaking, the more technical indicators , It can also be combined with screening effective indicators before bringing them into the prediction model
disclaimer
Nothing in this vision and analysis should be interpreted as investment advice , Past performance does not necessarily indicate future results .
Support vector machine 、 Decision tree 、 Stochastic forest model predicts stock price
We choose Maotai stock (600519) As an object of study , The data date range is 2020-01-01 To 2020-12-30. Uniform adoption of the last 64 Day data as test set , Last 64 The data of days ago is used as the training set
Support vector machine
Support vector machine (SVM) It is a kind of generalized linear classifier which classifies data according to supervised learning , The decision boundary is the maximum margin hyperplane for learning samples
In order to increase the nonlinearity of the model , use RBF Kernel function , The effect of the model is as follows
only 42.47% The accuracy of 
The accuracy is too low , The prediction is not accurate
Decision tree
Decision tree (Decision Tree) On the basis of knowing the probability of occurrence of various situations , The probability that the expected value of NPV is greater than or equal to zero is calculated by constructing decision tree , Evaluate project risks , The decision analysis method to judge its feasibility , It is a graphic method of intuitively using probability analysis . Because this kind of decision branch is like a tree's branch , So it's called decision tree . In machine learning , Decision tree is a prediction model , It represents a mapping relationship between object attributes and object values
The depth of the defined number is 5, The effect of the model is as follows
The accuracy on the training set is 77.53%, The accuracy on the test set is 56.25%, Compared with the support vector machine model, it has a certain improvement , But there are still big problems 
Although the accuracy has been improved, the prediction effect is still not good , And observe the output prediction results , Most of the time, it is predicted that it will fall , It shows that the classification effect is not very good
Random forests
Random forest is a classifier that contains multiple decision trees , And the output category is determined by the mode of the output category of the individual tree
Define the depth of the tree as 5, The number of random trees is 10, The effect of the model is as follows
The accuracy on the training set is 86.52%, The accuracy on the test set is 57.81%, The result of prediction is better than that of decision tree 
Slightly improved accuracy , The increase of recall rate is relatively large , But there is still much room for improvement
summary
After a simple test , The effect of random forest is relatively optimal
The main reason why the accuracy rate is low is that there are too few selected indicators , Want to know how many indicators are needed 、 Which indicators are more reliable are more helpful to the model , Further research is needed
边栏推荐
猜你喜欢

【SCA-CNN 解读】空间与通道注意力:Spatial and Channel-wise Attention
![[JS] battle chess](/img/1f/83ca6bcb000a5567dc6d3b72463ff8.jpg)
[JS] battle chess

AOF持久化

Build your own PE manually from winpe of ADK

也许尘埃落地,我们才能想清楚互联网的本质

kotlin 协程withContext切换线程

MySQL lpad() and rpad() concatenate string functions with specified length

Common skills for quantitative investment - drawing 2: drawing the moving average

Et5.0 value type generation

How many rounds of deep learning training? How many iterations?
随机推荐
Common skills of quantitative investment -- Drawing Part 1: Drawing stock closing price curve and ochl candle chart
深度学习模型剪枝
Set sail
硬(磁)盘(一)
从ADK的WinPE自己手动构建自己的PE
Aunt learning code sequel: ability to sling a large number of programmers
Physical orbit simulation
杂记:intel11代和12代移动版支持原生Thunderbolt4接口,桌面版不支持
Arduino control tm1637 common positive four digit nixie tube
Can GPU acceleration pytorch work?
Kotlin coroutine suspend function suspend keyword
[backtrader source code analysis 7] analysis of the functions for calculating mean value, variance and standard deviation in mathsupport in backtrader (with low gold content)
How many steps are appropriate for each cycle of deep learning?
[JS component] simulation framework
Kotlin 协程挂起函数 suspend 关键字
Kotlin collaboration, the life cycle of a job
Android Weather
MySQL queries the quantity of each month and the year-on-year and month on month data of each month
Cve-2021-24078 vulnerability analysis
Notes: the 11th and 12th generation mobile versions of Intel support the native thunderbolt4 interface, but the desktop version does not