0% found this document useful (0 votes)
45 views10 pages

Stock Market Prediction Using Machine Learning Techniques

The stock market is a very important activity in the finance business. Its demand is consistently growing. Stock market prediction is the process of determining the future value of company stock or other financial instruments traded on a financial exchange. For some decades Artificial Neural Network (ANN), which is one intelligent data mining technique has been used for Stock Price Prediction. It has been trusted as the most accurate consideration.

Uploaded by

SMARTX BRAINS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views10 pages

Stock Market Prediction Using Machine Learning Techniques

The stock market is a very important activity in the finance business. Its demand is consistently growing. Stock market prediction is the process of determining the future value of company stock or other financial instruments traded on a financial exchange. For some decades Artificial Neural Network (ANN), which is one intelligent data mining technique has been used for Stock Price Prediction. It has been trusted as the most accurate consideration.

Uploaded by

SMARTX BRAINS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Journal Publication of International Research for Engineering and Management

(JOIREM)
Volume: 10 Issue: 04 | April-2024

Stock Market Prediction Using Machine Learning Techniques


Shital Kacharu Jadhav

Prof. M. S. Nimase

Matoshree College of Engineering and research centre Eklahre Nashik

Abstract
Machine Learning, Stock Price, Prediction,
The stock market is a very important activity American Airlines, Support Vector Machine
in the finance business. Its demand is (SVR), Artificial Neural Network (ANN),
consistently growing. Stock market prediction Random Forest (RF), Decision Tree (DT).
is the process of determining the future value
of company stock or other financial
instruments traded on a financial exchange. 1. Introduction
For some decades Artificial Neural Network
(ANN), which is one intelligent data mining The Stock Market is the accumulation of
technique has been used for Stock Price stockbrokers, traders, and investors who
Prediction. It has been trusted as the most sell buy or share trades. There are so many
accurate consideration. This paper surveys companies that provide their stock list on
different machine learning models for stock market, these make their stocks attractive to
price prediction. We have trained the investors[1].Becauseeversincethe16sinvesto
available
rsaretryingdifferent
stockdataofAmericanAirlinesforthisproject.Th
eprogramminglanguagethatwe have used in techniquestogetknowledgeaboutdifferentco
this paper is Python. The Machine Learning mpaniestoimprovetheirinvestmentreturns[2]
(ML) models used in this project are Decision . It plays a very important role in increasing
Tree (DT), Support Vector Regression (SVR), a developing country’s economic status like
Random Forest (RF),and ANN. The India [3]. The demand for Stock Market is
datahereissplitinto70%fortrainingand30%fort growing significantly. We all know that it
esting.The dataset contains stock data for the has been in focus for many years because of
last 5 years. From the simulation results, it is the outstanding profits [4]. Lots of wealth
shown that Random Forest performs better as are traded daily through the stock market
compared to others. Thus, it can be used in and so it is seen as one of the most
the real-time implementation.
profitable financial outlets [5]. Now, the
Keywords stock market is one of the factors which
shows a country’s economy[6]. Many
people invest a hand some amount to

© 2024, JOIREM |www.joirem.com| Page 1


Journal Publication of International Research for Engineering and Management
(JOIREM)
Volume: 10 Issue: 04 | April-2024

money in the share market but some time The remaining paper has been laid
they tend to in curvery huge losses because out in the following order. In section -2
they depend upon the stockbrokers, who ad- literature survey has been reviewed
vise investors based on fundamental, followed by section -3 where various
technical, and time series [7]. Investors approaches or different machine learning
have been trying to find an intelligent idea algorithms used have been discussed. In
to overcome such problems. This is where section-4 the problems that occurred or
Stock Price Prediction comes into action that needed to be improved previously
because predicting stock prices is very have been addressed. Section-5
necessary [2]. represents all the information about the
dataset. In section-6 the results and
ACI’22:WorkshoponAdvancesinComputationIntelligence,itsConce
pts&ApplicationsatISIC2022,May17- future works have been discussed and in
19,Savannah,UnitedStatesEMAIL: [email protected] (A. section-7 the paper has been concluded.
1); [email protected] (A.2); [email protected]
(A. 3);[email protected] (A. 4)

2. Literature Survey
ORCID:0000-0001-5843-0335(A.3)
©️2020Copyrightforthispaperbyitsauthors.
UsepermittedunderCreativeCommonsLicenseAttribution4.0Internation
al(CCBY4.0).
CEURWorkshopProceedings(CEUR-WS.org)
Since the introduction of the Stock
Market so many predictors are
Stock Price Prediction's main idea is to constantly trying to predict stock values
accurately predict the future financial using different Machine Learning
outcome [5]. In the past few years, algorithms such as Support Vector
Machine Learning algorithms are seen to Regressor (SVR), Linear Regression
give promising results in various (LR), Support Vector Machine (SVM),
industries, so many traders are applying Neural Networks Genetic Algorithms,
these techniques to their respective fields and many more [5] on stocks of various
[8]. companies.
There is a diversity in many papers
ML can be applied as a game- based on different parameters. Many
changer [9]. In this paper, some different ML algorithms are used by
experimentation is done different authors based on different
bytakingdifferentMLalgorithmstopredict parameters. Some authors believe that
theopeningpriceofAmericanAirlinesstoc Neural Networks have given better
ks. The Machine learning (ML) performance as compared to other
algorithms that we have used are approaches [5]. Like, in paper [12]
Random Forest (RF), Decision Tree Hiransha M and Gopal Krishnan E. A
(DT), Support Vector Regressor (SVR), has trained four models Multi-Layer
and Artificial Neural Network [6]. Perceptron (MLP), Recurrent Neural
Prediction of Stocks is based on the Network (RNN), Convolutional Neural
opening price of the day for this paper. Network (CNN), and Long Short-Term

© 2024, JOIREM |www.joirem.com| Page 2


Journal Publication of International Research for Engineering and Management
(JOIREM)
Volume: 10 Issue: 04 | April-2024

Memory (LSTM) and it was observed Regression, Random Forest, and


that CNN has performed better than the Artificial Neural Network.
other three networks. On the other hand,
many authors believe that Support Decision Tree Methodology
Vector Regression which is known to
solve regression and prediction problems It is a supervised ML, which is used
gives better performance as seen in for both regressions as well as
paper[13] by Haiq in Yang, Laiwan classification. That is how it is also
Chan, and Irwin King. In paper [5] Paul called CART Classification and
d. Yoo has trained 3 models Support Regression Trees. In this algorithm, two
Vector Machine, Case- Based Reasoning nodes are present namely Decision Node
classifier (CBR), and Neural Networks which is for making the decisions and
(NN) from which Neural has given the can be divided into multiple branches
most appropriate prediction. Submit et al and Leaf Node which gives the output of
[18] has done an approach where they decisions and this
have combined two distinct fields for nodecan’tbefurtherdividedintomanynode
stock exchange analysis. It merges price s.ThefollowingistheformulaforLeafNode
prediction based on real time data as :
well as historical data with news 𝐼𝑛𝑓𝑜𝑟𝑚𝑎𝑡𝑖𝑜𝑛 𝐺𝑎𝑖𝑛=𝐶𝑙𝑎𝑠𝑠
analysis. In this paper LSTM(Long 𝐸𝑛𝑡𝑟𝑜𝑝𝑦 − 𝐸𝑛𝑡𝑟𝑜𝑝𝑦 𝐴𝑡𝑡𝑟𝑖𝑏𝑢𝑡𝑒 (1)
Short-Term Memory) is used for Branches-Here decision rules are set
prediction. The datasets are collected by which nodes can be divided further.
from large sets of business news in For Prediction, it starts from the root
which relevant and live data information node, compares values of the real
is present. Then the results of both attribute with the root attribute, and
analyses are combined to form a based on that comparison it follows the
response which helps visualize branch and jumps to the next node. This
recommendation for future increases. process continues until it reaches the leaf
So, in many papers, it has been node of the tree.
seen that neural networks give the Entropy-It is a metric that helps in
expected prediction value. measuring error in a given attribute. The
formula to find entropy is: -
3. Approaches Entropy(s)= -P(yes)log2
P(yes)- P(no) log2 P(no) (2) Here, (S)
In this project, prediction is carried implies the Total number of samples. P
out by using these ML algorithms. These (yes) refers to the Probability of S and
are Decision Tree, Support Vector P(no)means the Probability of no.

© 2024, JOIREM |www.joirem.com| Page 3


Journal Publication of International Research for Engineering and Management
(JOIREM)
Volume: 10 Issue: 04 | April-2024

Figure2.SupportVectorRegression

Figure1: Decision Tree Classifier Process Random Forest


Methodology
Support Vector Regression
Methodology Random forest is a supervised
Machine Learning algorithm that is used
ItisaSupervisedMachinelearningalg for Regression analysis. This over came
orithmusedforregressionanalysis.Itfind the problem of over fitting as seen in the
sthe function that helps us decision Tree [12]. It is an ensemble
approximate mapping based on the learning method. The steps for
training sample from an input domain prediction are first a random kdat a point
to real numbers. The Terminologies is picked from the training set then
contained in this are Hyper plane –this accordingly the decision tree is built.
is the line that is used to predict the Then choose the number of
continuous output. Kernel helps to treeswewanttobuildandagainfollowthepr
find hyper planes in evioussteps.Fromeverynewdatapoint,
higherdimensionalspacewithoutincreas make N tree Trees predict the value of Y
ingthecomputationalcostofitandthedeci for data points and assign new data
sion boundary is a simplification line points across all of y predicted Y values.
that differentiates positive examples
and negative examples.

© 2024, JOIREM |www.joirem.com| Page 4


Journal Publication of International Research for Engineering and Management
(JOIREM)
Volume: 10 Issue: 04 | April-2024

𝑖=1 𝑊𝑖∗𝑋𝑖+ 𝑏

(3) Here, b is the threshold value. X i is


input and value and Wi is the weight.

Figure3.RandomForestProcedure

Artificial Neural Network


Methodology
An artificial Neural network is an Figure4.ArtificialNeuralNetworkProcedure
interconnection of nodes that is like the
biological neuron in our body but not
4. Problem Statement
similar. For the last few decades, ANN
has been used for Stock Price Prediction
Now, stock brokers who execute
[12]. It contains three layers, first is the
trading main lydepend on their
Input Layer – this layer takes different
experience, price trends, or fundamental
inputs variable from the user then, the
analysis i.e.-buy or hold to select stocks.
hidden layer-This layer is present
These methods may lead to great losses
between
to investors if they make any wrong
the input layer which identifies all decisions because these are personalized
hidden features and patterns and the last and short-sighted due to their limited
layer is the Outputlayer- capacity. Lack of prominent results may
Thislayerprovidesthefinaloutput.ANNtak lead to reluctance to participate in
esdifferentinputsandmultiplies them with trading by investors. So, to overcome
the specified weights for each with an these drawbacks it is important to have a
activation function for the activation of tool that can guide us on proper trading
neurons. methods and consequences. Technical
The formula of the transfer function is: and fundamental analysis are the basis of
𝑛 future stock market Prediction. Here,

© 2024, JOIREM |www.joirem.com| Page 5


Journal Publication of International Research for Engineering and Management
(JOIREM)
Volume: 10 Issue: 04 | April-2024

Machine Learning methods come into Data Splitting


action. These methods can help us The processed data has been divided
analyze stock prices over time and create into 70% training data and 30% testing
side as about them and then help us in data using the train_test_split method.
prediction and can be used to model a Here881data is take nas training data
tool. and the rest 377 is kept For testing. The
training data values are taken from the
5. Stock Market Prediction date2013-02-08to2016-08-09 and the
testing data are from 2016-08-10 to
Architecture 2018-02-06.

Stock market data of American Table1:


airlines from 2-08-2013 to 2-07-2018 Dataset Feature Description Table
has been used as
adatasetinthisproject.Thisdatasethas1258

rowsand7columns.Eachrowrepresentsthe
information for a single day. For Figure5: Opening Price Graph
columns, the following are the feature
description. Data Scaling Standardization and
Data Preprocessing Normalization are done on the data using
It includes searching for essential Minmax Scaler and Standard Scaler to limit
missing or null values and replacing the ranges of variables to make them
them with mean values Searched for comparable on common grounds using ML
categorical value and if there is any methods.
unnecessary data then those values are Feature Selection
dropped. Theselectionoffeaturesisaveryimport

© 2024, JOIREM |www.joirem.com| Page 6


Journal Publication of International Research for Engineering and Management
(JOIREM)
Volume: 10 Issue: 04 | April-2024

anttasktopredictfuturevalues.Ifweconside to find the MAPE (Mean Absolute


r the worst features then the prediction Percentage Error),MAE(Me
can go wrong. In this paper, the attribute
or feature used for feature extraction is An Absolute Error), r RMSE (Root Mean
the opening price or the ‘open’ column Squared Error), and MSE (Mean Squared
of American Airlines stocks. A data Error) value
structure has been created with 7 time
steps and 1 output.
Prediction
We have adapted Machine Learning
Approaches to find the prediction. In this
case, training the model is very
necessary. Random Forest, Decision
Tree, and Support Vector Regression

Historicalr Importingall Data


awdata necessarylib prepro
Here, n is the sample size, Ai is the predicted
collect raries cessin
ion g value and Pi is the Predicted value.

Featur Lear Predic


eExtrac nin tiondo
tion ne by Figure6: Architecture of Methodology
gM model
and
feature od Testda As shown in the figure above all the
scaling el ta historical data were collected first and
Finding
Tra followed by the importation of all
Predict MAPE necessary libraries such as NumPy,
Results ini
Pandas, matplotlib, Sea born,
ng mean_squared_error, etc. In the next
models have been used to do the
dat step, various data processing methods
prediction work.
a have been performed such as drop, is
Error Calculation null, etc. Then feature extraction and
There are 4 types of error calculations feature scaling techniques have been
present for evaluation. implemented using Min Max Scaler and
In this paper, we have used them APE sc. fit_transform. In the next step we
method to find the error. Performance have trained the data and learned the
evaluation is done using MAPE value so model required. In the next step various
fall the models. Following are the formulae machine learning model which we have

© 2024, JOIREM |www.joirem.com| Page 7


Journal Publication of International Research for Engineering and Management
(JOIREM)
Volume: 10 Issue: 04 | April-2024

learned have been applied such as


Decision Tree, Support Vector, Artificial
Neural Networks, and Random Forest.
Then we have got the prediction results.
Out of all the 4 algorithms, Random
Forest has the lowest MAPE value i.e.-
0.36

6. Results and Discussion


The main objective of this project is Figure7MAPEComparison
to examine several different prediction
techniques top redict future stock prices 7. Conclusion
based on past returns. And here it is
visible that Random Forest The project was majorly aimed at
Is the best algorithm forth is research creating an efficient tool that will help
giving a MAPE value of 0.36.This stock brokers and in vestors properly
algorithms hall be used to predict invest in the stock market. Five years
opening prices shortly0 0. The following American Airlines stocks have been
is the table to show the MAPE values preprocessed and four machine learning
using Machine Learning Algorithms. algorithms have been used–Random
Table2 Forest, Support Vector Regressor,
MAPE Chart Decision Tree, and Artificial Neural
Network on this project. Based on
calculations, estimations, and
MAPE observations, we conclude that Random
Decisi Support Forest has the lowest Mean Absolute
on Tree Percentage Error (MAPE) value of 0.36
Vector followed by Artificial Neural Networks
Rando
Regress with the value of 0.37, then Decision
m
or Tree showing MAPE value of 1.6 and
Forest
the highest in SVR showing a value of
Artificia 3.5. Artificial Neural Network has been
1 3. 0. 0.
. 5 3l Neural3 used in this project, giving a MAPE
value of 0.37 which is these condleast
6 6 6Network7
MAPE value provided. So, in the future,
DE C SUPP RAN ARTIF it is intended to work on advanced ANN
IS ORT DO ICI evolutionary techniques like Genetic
IO VEC M AL Algorithm to decrease the MAPE values
N TOR FO NE U
T RE GR RE RAL
© 2024,
R JOIREM
E SSO |www.joirem.com|
ST NET Page 8
E R WOR
E K
Journal Publication of International Research for Engineering and Management
(JOIREM)
Volume: 10 Issue: 04 | April-2024

for better implementations. 2. IEEE, 2005.


6. S.Chakravarty,B.K.Paikaray,R.MishraandS.
Dash,"Hyperspectral ImageClassification
using Spectral Angle Mapper," 2021 IEEE
8. References International Women in Engineering (WIE)
Conference on Electrical and Computer
1. Bhattacharjee, Indronil, and Pryonti Engineering (WIECON-ECE), 2021, pp.
Bhattacharja. "Stock Price Prediction: A 87-90, doi: 10.1109/WIECON-
Comparative Study between Traditional ECE54711.2021.9829585.
Statistical Approach and Machine 7. Wanjawa, Barack Wamkaya, and
Learning Approach." 2019 4th Lawrence Muchemi. "ANN model to
International Conference on Electrical predict stock prices at stock exchange
Information and Communication markets." arXiv preprint
Technology (EICT). IEEE, 2019. arXiv:1502.06434 (2014).
2. Mehta,Yash,Atharva Malhar, and Radha 8. Reddy, V. Kranthi Sai. "Stock market
Shankarmani."Stock Price Prediction prediction using machine learning."
using Machine Learning and Sentiment International Research Journal of
Analysis." 2021 2nd International Engineering and Technology (IRJET)
Conference for Emerging Technology 5.10 (2018): 1033-1035.
(INCET). IEEE, 2021. 9. Ravikumar, Srinath, and Prasad Saraf.
3. Sharma,Ashish,DineshBhuriya,andUpen "Prediction of Stock Prices using
draSingh."Surveyofstockmarketpredictio Machine Learning (Regression,
nusing machine learning approach." Classification) Algorithms." 2020
2017 international conference of International Conference for Emerging
electronics, communication and Technology (INCET). IEEE, 2020.
aerospace technology (ICECA). Vol. 2. 10. Pathak, Ashish, and Nisha P. Shetty.
IEEE, 2017. "Indian stock market prediction using
4. Hegazy, Osman, Omar S. Soliman, and machine learning
Mustafa Abdul Salam. "A machine andsentimentanalysis."ComputationalInt
learning model for stock market elligenceinDataMining.Springer,Singap
prediction." arXiv preprint ore,2019. 595-603.
arXiv:1402.7351 (2014). 11. Deepak,RautSushrut,ShindeIshaUday,an
5. Yoo, Paul D., Maria H. Kim, and Tony dD.Malathi."Machinelearningapproachin
Jan. "Machine learning techniques and stock market prediction." International
use of event Journal of Pure and Applied
informationforstockmarketprediction:As Mathematics 115.8 (2017): 71- 77.
urveyandevaluation." 12. Hiransha, M., et al. "NSE stock market
InternationalConferenceon prediction using deep-learning models."
Computational Intelligence for Procedia computer science 132 (2018):
Modelling, Control and Automation and 1351-1362.
International Conference on Intelligent 13. Yang, Haiqin, Laiwan Chan, and Irwin
Agents, Web Technologies and Internet King. "Support vector machine
Commerce (CIMCA- IAWTIC'06). Vol. regression for volatile stock market

© 2024, JOIREM |www.joirem.com| Page 9


Journal Publication of International Research for Engineering and Management
(JOIREM)
Volume: 10 Issue: 04 | April-2024

prediction."International Conference on
Intelligent Data Engineering and
Automated Learning. Springer, Berlin,
Heidelberg, 2002.
14. Kohli,PahulPreetSingh,etal."Stockpredic
tionusingmachinelearningalgorithms."
Applications of Artificial Intelligence
Techniques in Engineering. Springer,
Singapore, 2019. 405-414.
15. Moedjahedy, Jimmy H., et al. "Stock
Price Forecasting on
Telecommunication Sector Companies
in Indonesia Stock Exchange Using
Machine Learning Algorithms." 2020
2nd International Conference on
Cybernetics and Intelligent System
(ICORIS). IEEE, 2020.
16. Mohanty,SachiNandan,etal.,eds.Recom
menderSystemwithMachineLearningand
Artificial Intelligence: Practical Tools
and Applications in Medical,
Agricultural, and Other Industries. John
Wiley & Sons, 2020.
17. Jain, Sarika, et al. "Human Disease
Diagnosis Using Machine Learning."
Intelligent Data Communication
Technologies and Internet of Things.
Springer, Singapore, 2021. 689-696.
18. Sarode, Sumeet, et al. "Stock price
prediction using machine learning
techniques." 2019 International
Conference on Intelligent Sustainable
Systems (ICISS). IEEE, 2019.

© 2024, JOIREM |www.joirem.com| Page 10

You might also like