Stock Price Prediction discussed in detail with detailed explanations

sadagopanselvarasu 0 views 37 slides Sep 26, 2025
Slide 1
Slide 1 of 37
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37

About This Presentation

stock prediction


Slide Content

Using Hyper-parameter tuning prediction and forecasting of stock price trends RA1811026010023 - Hiran V G RA1811026010012 - K. Sai Dinesh Guide Name : Dr. S. Sadagopan SRM INSTITUTE OF SCIENCE AND TECHNOLOGY FACULTY OF ENGINEERING AND TECHNOLOGY

Table of contents             Abstract Requirements Gathering Literature Survey Limitations Objectives and Problem Statement System Architecture Diagram Modules Description and Implementation Results Screenshots References 2/8/2022

ABSTRACT The volatility, complexness and price changes over the time making stock prediction more difficult . To make this process more reliable, the proposed system provides an approach towards prediction of stock market price using machine learning models. The regularization of parameters can be identified and can be added to effectively learn and machine learning algorithm. The experimental results shows that the prediction accuracy can be achieved through the regularization and parameter selection. 2/8/2022

Introduction In statistics and machine learning the problem that involves deciding which category a new observation belongs to among a set of categories using a dataset for training which contains observations whose category membership is mentioned. In machine learning, classification is regarded as an example of supervised learning Proposed work will develop a financial data predictor program To predict the stock prices in NSE, this project aims at developing a program, which serves best solution for accurate predicted stock result. 2/8/2022

PROBLEM STATEMENT Volatility as a measure of price fluctuations has a significant impact on trade strategies and investment decision as well as on option pricing and measures of systemic risk. The more the volatile, the more in deviation on predicted prices. If the volatility is low, then the prediction may be reliable. 2/8/2022

OBJECTIVES   Our objectives of study is to use machine learning techniques with parameter selection and regularization method The forecasting problem of stock price is treated as a classification problem to make better decisions. The ability to forecast the direction of a stock price reduces the risk of investment for the investors and supporting in identifying opportunities for speculators seeking to make profits by investing in stocks. 2/8/2022

REQUIREMENTS GATHERING 2/8/2022 Functional requirements: Data collection Data visualization

Data visualization for stock SBIN 2/8/2022

REQUIREMENTS GATHERING 2/8/2022 Non- Functional requirements: Maintainability Portability Performance Accuracy

LITERATURE SURVEY Year First Author Publication Details Approach 2020 Zixuan Liu[1] Z. Liu, Z. Dang and J. Yu, "Stock Price Prediction Model Based on RBF-SVM Algorithm," 2020 International Conference on Computer Engineering and Intelligent Control (ICCEIC), 2020, pp. 124-127, doi: 10.1109/ICCEIC51584.2020.00032. Used RBF (Radial Basis Function) Kernel for Support Vector machine (SVM) algorithm for stock price prediction with accuracy around 65% and in short span of time 2020 Y. Wei [2] Y. Wei and V. Chaudhary, "The Directionality Function Defect of Performance Evaluation Method in Regression Neural Network for Stock Price Prediction," 2020 IEEE 7th International Conference on Data Science and Advanced Analytics (DSAA), 2020, pp. 769-770, doi: 10.1109/DSAA49011.2020.00108. Used Neural network based directionality finding and reduced the error in prediction. 2020 X. Yuan[3] X. Yuan, J. Yuan, T. Jiang and Q. U. Ain, "Integrated Long-Term Stock Selection Models Based on Feature Selection and Machine Learning Algorithms for China Stock Market," in IEEE Access, vol. 8, pp. 22672-22685, 2020, doi: 10.1109/ACCESS.2020.2969293. Used SVM, Random forest and Artificial neural network analyzed the price prediction. Of these, random forest was proposed the best model. 2020 S. Kim [4] S. Kim, S. Ku, W. Chang and J. W. Song, "Predicting the Direction of US Stock Prices Using Effective Transfer Entropy and Machine Learning Techniques," in IEEE Access, vol. 8, pp. 111660-111682, 2020, doi: 10.1109/ACCESS.2020.3002174. Used Effective transfer Entropy to introduce an attribute for learning and machine learning algorithm applied and achieved accuracy of around 53% in XGB 2020 Khan[5] Khan, W., Ghazanfar, M.A., Azam, M.A. et al. Stock market prediction using machine learning classifiers and social media, news. J Ambient Intell Human Comput (2020). https://doi.org/10.1007/s12652-020-01839-w Used Social media news and financial news for trend prediction, Gradient boost model has achieved highest sentiment classification accuracy of 76% 2/8/2022

2/8/2022 Year First Author Publication Details Approach 2018 Xianxian Hou [6] X. Hou, S. Zhu, L. Xia and G. Wu, "Stock price prediction based on Grey Relational Analysis and support vector regression," 2018 Chinese Control And Decision Conference (CCDC), 2018, pp. 2509-2513, doi: 10.1109/CCDC.2018.8407547. Used Grey relational analysis and Support vector machine algorithm and with PSO-SVM achieved less MSE error 0.1627 2019 Mehar Vijh[7] Mehar Vijh, Deeksha Chandola, Vinay Anand Tikkiwal, Arun Kumar, Stock Closing Price Prediction using Machine Learning Techniques, Procedia Computer Science, Volume 167,2020,
ISSN 1877-0509 Stock closing price prediction is done using ANN and Random forest for five top stocks of different sectors. Of these, RMSE error is less for ANN algorithm 2020 Zhao [8] Zhao, J., Zeng, D., Liang, S. et al. Prediction model for stock price trend based on recurrent neural network. J Ambient Intell Human Comput 12, 745–753 (2021). https://doi.org/10.1007/s12652-020-02057-0 Stock price prediction with long memory model RNN and LSTM . Attention based LSTM is achieved good accuracy 2021 N.Naik[9] N. Naik and B. R. Mohan, "Novel Stock Crisis Prediction Technique—A Study on Indian Stock Market," in IEEE Access, vol. 9, pp. 86230-86242, 2021, doi: 10.1109/ACCESS.2021.3088999. Stock Crisis prediction through feature selection and performed analysis shown that FS with XGB has given less MSE error comparing FS-DNN 2021 Ziyue Li[10] Z. Li, S. Lyu, H. Zhang and T. Jiang, "One Step Ahead: A Framework for Detecting Unexpected Incidents and Predicting the Stock Markets," in IEEE Access, vol. 9, pp. 30292-30305, 2021, doi: 10.1109/ACCESS.2021.3059283. Detecting unexpected events on stock market is studied by adding news flows content to learning model. Analyzed with ML algorithm Decision Tree achieved good precision of 70%

2/8/2022 Year First Author Publication Details Approach 2021 Xiaodong Li[11] Li, X., Wu, P. Stock Price Prediction Incorporating Market Style Clustering. Cogn Comput (2021). https://doi.org/10.1007/s12559-021-09820-1 Stock price prediction considered market style is studied. The data is tunes as time series windows and clusters made. Combining this to SVM has given high F1 score 2020 T. Xia et al [12] T. Xia et al., "Improving the Performance of Stock Trend Prediction by Applying GA to Feature Selection," 2018 IEEE 8th International Symposium on Cloud and Service Computing (SC2), 2018, pp. 122-126, doi: 10.1109/SC2.2018.00025. Stock trend predicted based on Genetic algorithm for feature selection is used. 2021 S. Chen  [13] S. Chen and C. Zhou, "Stock Prediction Based on Genetic Algorithm Feature Selection and Long Short-Term Memory Neural Network," in IEEE Access, vol. 9, pp. 9066-9072, 2021, doi: 10.1109/ACCESS.2020.3047109. Genetic Algorithm features were fed to LSTM model for predicting the stock prices. GA-LSTM has given less MSE error 0.0047 2021 S.M.Carta[14] S. M. Carta, S. Consoli, L. Piras, A. S. Podda and D. R. Recupero, "Explainable Machine Learning Exploiting News and Domain-Specific Lexicon for Stock Market Forecasting," in IEEE Access, vol. 9, pp. 30193-30205, 2021, doi: 10.1109/ACCESS.2021.3059960. Magnitude of future stock price is predicted as binary classification based on the lexicon derived from news articles, SVM was suggested best model for classification 2019 P. K. Aithal[15] P. K. Aithal, A. U. Dinesh and M. Geetha, "Identifying Significant Macroeconomic Indicators for Indian Stock Markets," in IEEE Access, vol. 7, pp. 143829-143840, 2019, doi: 10.1109/ACCESS.2019.2945603. Total 44 macro economic features are identified and reduced to seven by Principal component analysis(PCA) and trend predicted

LIMITATIONS IDENTIFIED FROM SURVEY Machine leaning models when used clustering, classification and regression, they have given good accuracy than some deep learning models. Some of the problem analyzed the crisis prediction and unexpected event predictions. Some of the events considered in market becomes non-event and it may not affect prices all times. Sentimental analysis and news based analysis based on NLP processing was studied. 2/8/2022

System Architecture 2/8/2022

Block Diagram 2/8/2022

MODULES DESCRIPTION AND IMPLEMENTATION MODULES: Dataset Collection in real time Parameter tuning and regularization techniques Machine learning and Price prediction Price forecast 2/8/2022

MODULES DESCRIPTION AND IMPLEMENTATION Dataset Collection in real time Live data from 2000 to till date is collected from nseindia.com The data collected with following features and stored as data.csv “Time_stamp, Symbol, Series, Prevclose, Open, High, Low, Close, VWAP, Volume”. 2/8/2022

MODULES DESCRIPTION AND IMPLEMENTATION Parameter tuning and regularization techniques Hyper parameter learning is more useful to understand the characteristics and learning behavior of algorithm. The more hyperparameters of an algorithm that is tuned, the slower the tuning process. Not all model hyperparameters are more important, some of them have greater impact on the performance of a machine learning algorithm. 2/8/2022

MODULES DESCRIPTION AND IMPLEMENTATION Machine learning and prediction We are going to analyze machine learning model with the hyper parameter selected by the above model Random Forest Model Decision Tree K-NN Model 2/8/2022

MODULES DESCRIPTION AND IMPLEMENTATION Price Forecast The result is compared with the score value to identify the accuracy value and plotted. df['label'] = df[forecast_col].shift(-forecast_out) X = np.array(df.drop([‘label'],1)) X = preprocessing.scale(X) X_lately = X[-forecast_out:] X = X[:-forecast_out] 2/8/2022

Algorithms Used GridSearchCV for Parameter Tuning Decision Tree Random Forest K-Nearest Neighbor 2/8/2022

Algorithm- GridSearchCV Step 1: Define a dictionary in which mention hyperparameter along with the values it can take Step 2: GridSearchCV tries all possible combinations of the parameters given in dictionary and evaluates the model for each combination through Cross-Validation method. Step 3: Find the accuracy metrics and choose the best parameter Parameters Used   1.estimator: Pass the model instance for which you want to check the hyperparameters. 2.params_grid: the dictionary object that holds the hyperparameters you want to try 3.scoring: evaluation metric that you want to use, you can simply pass a valid string/ object of evaluation metric 4.cv: number of cross-validation you have to try for each selected set of hyperparameters 5.verbose: you can set it to 1 to get the detailed print out while you fit the data to GridSearchCV 6.n_jobs: number of processes you wish to run in parallel for this task if it -1 it will use all available processors. 2/8/2022

Cross Validation methods Used Holdout and K-fold 2/8/2022

Algorithm: Decision Tree Step-1: Begin the tree with the root node, says S, which contains the complete dataset. Root node represents the entire sample and this further divided into two or more sets. Step-2: Find the best attribute in the dataset using Attribute Selection Measure (ASM). Step-3: Divide the S into subsets that contains possible values for the best attributes. Step-4: Generate the decision tree node, which contains the best attribute. Step-5: Make new decision trees using the subsets of the dataset created in step -3 Step 6: Continue this process till final node is reached as leaf node 2/8/2022

Algorithm- Random Forest Step-1: Select random K data points from the training set. Step-2: Build the decision trees associated with the selected data points (Subsets). Step-3: Choose the number N for decision trees that you want to build. Step-4: Repeat Step 1 & 2. Step-5: For new data points, find the predictions of each decision tree, and assign the new data points to the category that wins the majority votes. 2/8/2022

Algorithm- KNN Step-1: Select the number K of the neighbors Step-2: Calculate the Euclidean distance of K number of neighbors Step-3: Take the K nearest neighbors as per the calculated Euclidean distance. Step-4: Among these k neighbors, count the number of the data points in each category. Step-5: Assign the new data points to that category for which the number of the neighbor is maximum. Step-6: Fit the model to get a trained one 2/8/2022

Use Case Diagram 2/8/2022

Implementation Data Collection in real time Input has be given stock name, any NSE stock data can be retrieved real time 2/8/2022

Price prediction through machine learning 2/8/2022

Hyper tuning model for decision tree algorithm 2/8/2022

RESULTS PARAMETERS SELECTED FOR DECISION TREE 2/8/2022

Original Stock price Vs Predicted Stock Price 2/8/2022

Comparison of metrics Decision Tree Vs Hyper tuned DT 2/8/2022

Improved Accuracy through Hyper tuned model 2/8/2022

REFERENCES 1. Z. Liu, Z. Dang and J. Yu, "Stock Price Prediction Model Based on RBF-SVM Algorithm," 2020 International Conference on Computer Engineering and Intelligent Control (ICCEIC), 2020, pp. 124-127, doi: 10.1109/ICCEIC51584.2020.00032. 2. Y. Wei and V. Chaudhary, "The Directionality Function Defect of Performance Evaluation Method in Regression Neural Network for Stock Price Prediction," 2020 IEEE 7th International Conference on Data Science and Advanced Analytics (DSAA), 2020, pp. 769-770, doi: 10.1109/DSAA49011.2020.00108. 3. X. Yuan, J. Yuan, T. Jiang and Q. U. Ain, "Integrated Long-Term Stock Selection Models Based on Feature Selection and Machine Learning Algorithms for China Stock Market," in IEEE Access, vol. 8, pp. 22672-22685, 2020, doi: 10.1109/ACCESS.2020.2969293. 4. S. Kim, S. Ku, W. Chang and J. W. Song, "Predicting the Direction of US Stock Prices Using Effective Transfer Entropy and Machine Learning Techniques," in IEEE Access, vol. 8, pp. 111660-111682, 2020, doi: 10.1109/ACCESS.2020.3002174. 5. Khan, W., Ghazanfar, M.A., Azam, M.A. et al. Stock market prediction using machine learning classifiers and social media, news. J Ambient Intell Human Comput (2020). https://doi.org/10.1007/s12652-020-01839-w 6. X. Hou, S. Zhu, L. Xia and G. Wu, "Stock price prediction based on Grey Relational Analysis and support vector regression," 2018 Chinese Control And Decision Conference (CCDC), 2018, pp. 2509-2513, doi: 10.1109/CCDC.2018.8407547. 7. Mehar Vijh, Deeksha Chandola, Vinay Anand Tikkiwal, Arun Kumar, Stock Closing Price Prediction using Machine Learning Techniques, Procedia Computer Science, Volume 167,2020, ISSN 1877-0509 2/8/2022

8. Zhao, J., Zeng, D., Liang, S. et al. Prediction model for stock price trend based on recurrent neural network. J Ambient Intell Human Comput 12, 745–753 (2021). https://doi.org/10.1007/s12652-020-02057-0 9. N. Naik and B. R. Mohan, "Novel Stock Crisis Prediction Technique—A Study on Indian Stock Market," in IEEE Access, vol. 9, pp. 86230-86242, 2021, doi: 10.1109/ACCESS.2021.3088999. 10. Z. Li, S. Lyu, H. Zhang and T. Jiang, "One Step Ahead: A Framework for Detecting Unexpected Incidents and Predicting the Stock Markets," in IEEE Access, vol. 9, pp. 30292-30305, 2021, doi: 10.1109/ACCESS.2021.3059283. 11. Li, X., Wu, P. Stock Price Prediction Incorporating Market Style Clustering. Cogn Comput (2021). https://doi.org/10.1007/s12559-021-09820-1 12. T. Xia et al., "Improving the Performance of Stock Trend Prediction by Applying GA to Feature Selection," 2018 IEEE 8th International Symposium on Cloud and Service Computing (SC2), 2018, pp. 122-126, doi: 10.1109/SC2.2018.00025. 13. S. Chen and C. Zhou, "Stock Prediction Based on Genetic Algorithm Feature Selection and Long Short-Term Memory Neural Network," in IEEE Access, vol. 9, pp. 9066-9072, 2021, doi: 10.1109/ACCESS.2020.3047109. 14. S. M. Carta, S. Consoli, L. Piras, A. S. Podda and D. R. Recupero, "Explainable Machine Learning Exploiting News and Domain-Specific Lexicon for Stock Market Forecasting," in IEEE Access, vol. 9, pp. 30193-30205, 2021, doi: 10.1109/ACCESS.2021.3059960. 15. P. K. Aithal, A. U. Dinesh and M. Geetha, "Identifying Significant Macroeconomic Indicators for Indian Stock Markets," in IEEE Access, vol. 7, pp. 143829-143840, 2019, doi: 10.1109/ACCESS.2019.2945603. 2/8/2022

Thank You 2/8/2022
Tags