Stock Price Prediction Using ML Algorithms
Stock Price Prediction Using ML Algorithms
https://doi.org/10.22214/ijraset.2023.52944
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue V May 2023- Available at www.ijraset.com
Abstract: Stock Price Prediction using ML( Machine Learning) helps to determine the unborn value of stocks of any fiscal
means traded on an exchange. The entire generality of prognosticating stock prices is to gain significant gains by minimizing
losses vaticinating the stock request price is always challenging for numerous business judges and experimenters. vaticination of
the stock request plays a vital part in the stock business. The compass gradationally expanded. The time series model cannot
contribute to the non- linear part of the stock data and is therefore hamstrung for the long term, and LSTM neural network
makes better use of non-sequential data and has better use of sequence data. Useful information in the long term which makes
the root mean square error of the vaticination result, the LSTM neural network needs lower than the time series model, showing
LSTM is a better stock price soothsaying system. Machine Learning approach to predict or sense the behavior tracking of the
stock market Sensex. Random Forest is the Machine Learning model implemented effectively in predicting the stock prices and
defining the activity between the exchanges the securities between the buyers and sellers.
Keywords: LSTM – Long Short-Term Memory, ANN – Artificial Neural Network, RNN– Recurrent Neural network, TSLM–
Time Series Linear Model, SVM – Support Vector Machine, ML – Machine Learning, CNN – Convolutional Neural Network,
NN – Neural Network, SVM-Support Vector Machine
I. INTRODUCTION
The stock request appears in the news every day. We hear about it every day it reaches a new high or a newlow. And so, the
companies are facing multiple losses because of not- so-effective styles or ways. With the ultramodern advancements in
artificial intelligence, there has been the creation of new fine tools like deep literacy and underpinning literacy. Numerous
businesses use data wisdom and analytics to gain optimized results for colorful business issues. Stock trading is one of the
most important conditionings in the finance world. Stock is a security that represents the power of a bit of the issuing pot. It
entitles you to be a part of that company's earnings and means. Stock request vaticination can be defined as trying to determine
the unborn value of a stock or other fiscal instrument that's traded on a fiscal exchange. In this design we are using Long Short-
Term Memory( LSTM) is one of the numerous types of intermittent Neural Network RNN, it’s also able of catching data from
once stage and use it for unborn prognostications[1]. As suggested by[2] The Long Short Term Memory( LSTM) networks
are a type of intermittent neural network( RNN) able of addressing direct problems an effective model for the successful
vaticination of a stock's unborn price can lead to heftygains. An average stock exchange creates nearly trillions of Gigabytes of
trade and order book data in a month. The rising fashion ability of machine literacy in colorful diligence has enlightened numerous
dealers to apply machine literacy ways to the field, and some of them have produced relatively promising result.
Machine literacy provides a unique perspective to us on understanding the stock request and fiscal data. Investors can easily
determine whether it's worth investing in a particular stock. Algorithmic Trading not only just makes a purchase or vend decision
but also recommends the product efficiently. Stock prices no way vary in insulation the movement of one tends to have an
avalanche effect on several other stocks as well[3]. The major thing is to minimize the query of the returns by directly
prognosticating unborn stock prices and also relating their oscillations in advance to reduce pitfalls. Multiple trees are combined in
the random forest to predict the class of the dataset. Some decision trees may correctly predict the output, while others may not.
However, when taken as a whole, each tree predicts the correct outcome. The fundamental idea of demand-and-supply economic
policy serves as the foundation for this. For instance, theprice of a particular company's share always falls when there is less demand
for that company's stock[4,5].
II. RELATED WORK
Stock Price Prediction using ML( Machine Learning) helps to determine the unborn value of stocks of any fiscal means traded on an
exchange. The entire generality of prognosticating stock prices is to gain significant gains by minimizing losses. vaticinating the
stock request price is always challenging for numerous business judges and experimenters. Jordan Prosky et al.[6] suggested that,
the CNN methodologies and its operation in prognosticating stock prices, a system to apply sentiment analysis on stock vaticination.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 5426
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue V May 2023- Available at www.ijraset.com
It's veritably delicate to prognosticate the stock request with full delicacy as external realities similar to social, cerebral, political and
profitable have a considerable influence on it. As mentioned by. Shao and. Ma[7] it's a more general interpretation of the reopened
intermittent system. LSTM is more benign than other deep literacy styles The main specific of the data associated with the stock
request is generally time-variant and nonlinear. Manoj S Hegde etal.[8] delved The Long Short Term Memory networks are a type
of intermittent neural network( RNN) able of working in volute direct problems, and there's a discussion about the operation of
RNN( intermittent Neural Networks) to prognosticate the share prices. As Kim and H.Y. Kim etal.[9] linked that another significant
issue with introductory ANNs for stock cast vaticination of the stock request plays a vital part in the stock business. Investors gain
sufficient information and knowledge about the investment and can help those suffering from the topmost loss. To make the
prognostications we're using Microsoft data available on the Kaggle website. The stock price data will be supplied as a Comma
Separated train that may be opened and anatomized in Excel or a Spreadsheet. The Opening Value of the stock, the Highest and
smallest values of that stock on the same day, as well as the losing Value at the end of the day, are all indicated for each date. Tao
Xing and Yuan Sun et al.[10] suggested a model which considers the literal equity share price of a company price and applies RNN(
intermittent) fashion called Long Short Term Memory( LSTM). Time series analysis is a technical branch of statistics used
considerably Stock Price Prediction using ML( Machine Learning) helps to determine the future value of stocks of any financial
means traded on an exchange. The entire generality of predicting stock prices is to gain significant earnings by minimizing losses.
Xi Zhang1 et al.[11] suggested that stock requests play critical place in ultramodern society's profitable operations. It's truly delicate
to predict the stock request with full delicacy as external realities analogous to social, cerebral, political and profitability have a
considerable influence on it. M. Roondiwala[12] proposed that Long Short Term Memory is the most popular RNN armature. We
are using Microsoft Corporation( MSFT) data for examination. The stock price data will be supplied as a Comma Separated train
that may be opened and analyzed in Excel or a Spreadsheet. The Opening Value of the stock, the Highest and lowest values of
that stock on the same day, as well as the losing Value at the end of the day, are all indicated for each date. Time Series auguring &
modelling play an important part in data analysis. Time series analysis is a specialized branch of statistics used vastly in fields
analogous to Econometrics & Operation Research. The deep learning method, developed by Christian Slamka, Bernd Skiera, and
Martin Spann[13] uses word embedding, document labelling, data preprocessing, and finding indicators to predict prices. The main
thing of this design is to predict stock prices using ML Algorithms in fields similar to Econometrics & Operation Research. The
main thing of this design is to prognosticate stock prices using ML Algorithm. Tae Kyun Lee, Joon HyungCho, Deuk SinKwon and
So YoungSohn[14] have experimented and stated that the Random Forest model gave 54.12 accuracies among the here models
which are used by authors for stock market prediction.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 5427
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue V May 2023- Available at www.ijraset.com
2) Random Forest: Random Forest works in two-phase first is to create the random forest by combining N decision tree, and the
second is to make predictions for each tree created in the first phase.
Working of Random Forest:
"Random Forest is a classifier that contains a number of decision trees on various subsets of the given dataset and takes the
average to improve the predictive accuracy of that dataset."
Algorithm 2: Stock prediction using Random Forest The Working process can be explained in the below stepsStep-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 tothe category that wins the
majority votes
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 5428
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue V May 2023- Available at www.ijraset.com
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 5429
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue V May 2023- Available at www.ijraset.com
Screenshot of Predictions
The perpetration of proposed LSTM model using python which predicts the unborn price of Microsoft data partake grounded on its
literal data. The proposed algorithm can prognosticate the share price with a veritably low loss and error rate. This perpetration
provides us with a large range of parameters similar to learning rates, and input and affair impulses. The proposed algorithm works
veritably and effectively on alarge set of data.
No fine adaptations are needed. The complexity to modernize each weight is reduced to O(1) with LSTMs, analogous to that of
Back Propagation Through Time( BPTT), which is an advantage. LSTMs give us a large range of parameters similar to learning
rates, and input and affair impulses.
A long short-term memory network ( LSTM) is a particular form of intermittent neural network( RNN).
The implementation of the proposed Random Forest model using Python predicts the future price ofMICROSOFT shares based on
its historical data.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 5430
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue V May 2023- Available at www.ijraset.com
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 5431
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue V May 2023- Available at www.ijraset.com
REFERENCES
[1] Soulas, Eleftherios, and Dennis Shasha. “Online machine learning algorithms for currency exchange prediction.” Computer Science Department in New York
University, Tech. Rep 31 (2013).Stock price prediction using random forest by Maryamu Zakariya.
[2] M. S. Hegde, G. Krishna and R. Srinath, "An Ensemble Stock Predictor and Recommender System,"2018 International Conference on Advances in Computing,
Communications and Informatics (ICACCI), Bangalore, 2018, pp. 1981-1985
[3] M. Roondiwala, H. Patel and S. Varma, "Predicting stock prices using LSTM," International Journal of Science and Research (IJSR), vol. 6, no. 4, pp. 1754-
1756, 2017.
[4] Tao Xing, Yuan Sun, Qian Wang, Guo Yu. "The Analysis and Prediction of Stock Price", 2013 IEEE International Conference on Granular Computing (GrC),
ISBN: 978-1-4799-1282-7, DOI: 10.1109/GrC.2013.6740438.
[5] Patterson J., 2017. Deep Learning: A Practitioner’s Approach, O’Reilly Media.
[6] T. Kim and H. Y. Kim, "Forecasting stock prices with a feature fusion LSTM-CNN model using different representations of the same data," PloS one, vol. 14,
no. 2, p. e0212320, April 2019K.
[7] Xi Zhang1, Siyu Qu1, Jieyun Huang1, Binxing Fang1, Philip Yu2, “Stock Market Prediction viaMulti-Source Multiple Instance Learning.” IEEE 2018.
[8] Jordan Prosky, Andrew Tan, Xingyou Song, Micael Zhao. "Sentiment Predictability for Stocks" -arXiv:1712.05785v2 [cs.CL], 18 Jan 2018.
[9] X. Shao, D. Ma, Y. Liu, Q. Yin. "Short-term forecast of stock price of multi-branch LSTM based on K-means", 2017 4th International Conference on Systems
and Informatics (ICSAI).
[10] Somaraju Dinesh , Adduri Maruthi Siva Rama Raju stock price prediction using lstm and rnn. Stock Price prediction system by Pramod B S1 , Mallikarjuna
Shastry using LSTM.
[11] Stock Price Prediction Using Long Short Term Memory Raghav Nandakumar1, Uttamraj K R2,Vishal R3, Y V Lokeswari.
[12] Stock Market Prediction Using LSTM Recurrent Neural Network Adil MogharMhamed HAMICHE.
[13] Joseph St. Pierre et al, “Trading the stock market using Google search volumes: a long short-term memory approach”, Volume: 3, Issue: 1, Date: 2019.
[14] Kang Zhang et al, ”Stock Market Prediction Based on Generative Adversarial Network”, Volume:147, Issue:2, Date:2019.
[15] Christian Slamka et al, ”Prediction Market Performance And Market Liquidity: A Comparison of Automated Market Makers”Volume:60, Issue:1,Date: April
2012.
[16] Tae Kyun Lee et al, ”Global Stock Market Investment Strategies Based On Financial Network Indicators Using Machine Learning Techniques”, Volume: 117,
Issue: 1, Date: 2019.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 5432