You are on page 1of 12

SRINIVAS

UNIVERSITY

Mini-Project :-
Stock market analysis using machine
learning

By:-
N B Dhinesh Kumar
Electronic and
communication engg..
Abstract :-
Stocks are possibly the most popular financial instrument
invented for building wealth and are the centerpiece of any
investment portfolio. The advances in trading technolo-gy has
opened up the markets so that nowadays nearly anybody can
own stocks. From last few decades, there seen explosive
increase in the average person’s interest for stock market.

In a financially explosive market, as the stock market, it is important


to have a very accurate prediction of a future trend. Because of the
financial crisis and re-cording profits, it is compulsory to have a
secure prediction of the values of the stocks. Predicting a non-linear
signal requires progressive algorithms of machine learning with
help of Artificial Intelligence (AI).

In this context this study uses a machine learning


technique called Support Vector Machine (SVM) to
predict stock prices for the large and small
capitalizations and in the three different markets,
employing prices with both easily and up-to-the-minute
frequencies
Introduction :-
Stock market is trading platform where different investors sale and purchase shares according to stock
availability. Stock market ups and downs effects the profit of stakeholders. If market prices going up
with available stock then stakeholders get profit with their purchased stocks. In other case, if market
going down with available stock prices then stakeholders have to face losses. Buyers buy stocks with low
prices and sell stocks at high prices and try to get huge profit. Similarly, sellers sell their products at high
prices for profit purpose Stock market (SM) work as trusty platform among sellers and buyers.
Advances in Artificial Intelligence (AI) supporting a lot in each field of life with its intelligent features.

Several algorithms present in AI that performing their role in future predictions . Machine learning (ML) is a
field of artificial intelligence (AI) that can be considered as we train machines with data and analysis future with
test data. Machines can be trained on the basis of some standard that are called algorithms. Stock market
predictions can be great beneficial to businessman. SMP provide future trend of stock prices on the basis of
previous history . If stakeholders get future predictions then investment can lead him toward profit. Predictions
can be 50% correct and 50% wrong as it is risk of business. Risks facing capability in business filed can lead
toward success. In any field of life, we take risks for success. Similarly, we rely on ML predictions about future
prices of stock.
In this chapter we would like to explain these ML algorithms with the help of their
working methodologies and examples .Before working on actual problem SMP,
complete understanding of ML algorithms role in prediction is also necessary. That’s
why in this chapter we explained complete working scenario and problem
definition .Several Machine learning algorithms can be used for stock market
prediction but in this research we used few algorithms . if we further consider many
other algorithms can also be used for Stock Market Prediction(SMP) .
Literature Survey :-
Chavan and Patil (2013) contribute to our understanding of ANN (Artificial Neural Networking) stock
market prediction by surveying different model input parameters found in nine published articles. They
attempt to find the most important input parameters that produce better model prediction accuracy.
Based on their survey, they find that most ML techniques make use of technical variables instead of
fundamental variables for a particular stock price prediction, while microeconomic variables are
mostly used to predict stock market index values. In addition, hybridized parameters produce better
results when compared with the use of only a single input variable type.

A dynamic fuzzy model is proposed by Chiu and Chen (2009) in


combination with a SVM to explore stock market dynamics. The fuzzy model
integrates input variables using factors with varying degrees of influence. A
GA adjusts the influential degree of each input variable dynamically. The
SVM is then used to predict stock market dynamics. A multi-period
experiment is designed to simulate stock market volatility. The 61 input
variables in the study include stock market technical indicators, futures
market technical indicators, and macroeconomic variables. To evaluate the
performance of the new integrated model, they compare it with traditional
forecast methods. The experimental results show that the model is more
accurate when compared with alternative prediction methods.
Zhong and Enke (2019) present a process to predict the daily return direction of a set of stocks.
Deep neural networks (DNNs) and traditional ANNs are deployed over the entire preprocessed,
but untransformed, dataset along with two datasets transformed via principal component analysis
(PCA) to predict the daily direction of future stock market index returns. While controlling for
overfitting, a pattern for the classification accuracy of the DNNs is detected and demonstrated as
the number of the hidden layers increases gradually from 12 to 1000. Simulation results show that
the DNNs using two PCA-represented datasets give significantly higher classification accuracy
than those using the entire untransformed dataset or other hybrid machine learning algorithms.
The trading strategies guided by the DNN classification process based on PCA-represented data
perform slightly better than the others tested, including a comparison against two standard
benchmarks.
Methodology :-
In this project the prediction of stock market is done by the Support Vector Machine (SVM) and
Radial Basis Function (RBF).
Support Vector Machine (SVM) :-
A Support Vector Machine (SVM) is a discriminative classifier that formally defined by the separating
hyperplane.Support Vector Machine (SVM) is considered to be as one of the most suitable algorithms
available for the time series prediction. The supervised algorithm can be used in both, regression and
classification. The SVM involves in plotting of data as point in the space of n dimensions.These dimensions
are the attributes that are plotted on particular co-ordinates. SVM algorithm draws a boundary over the data
set called as the hyper-plane, which separates the data into two classes as shown in the Fig 1.

Considering the same figure, if µ is some unknown data point and w is


vector which is perpendicular to the hyper-plane, then the SVM decision
rule will be
Radial Basis Function (RBF):-

In the machine learning, the radial basis function kernel, or RBF kernel, is a
popular kernel function used in the various kernelized learning algorithms. In
particular, it is most commonly used in support vector machine classification. A
radial basis function is the real-valued function whose value depends only on
the distance from the origin or alternatively on the distance from some other
point called a center.
RBF = Local Response Function

The RBF Kernel is nothing more than a low-band pass


filter, which is well known in Signal Processing as a
tool to smooth images. RBF Kernel acts as the prior
that selects out smooth solutions.The RBF kernel is
defined as
KRBF (x, x’) = exp [-y ||x –x’||2]
Where y is the parameter that sets “spread” of the
kernel
The Learning Environment:-
The general setup used is as follows:
In this paper we focus on predicting the Stock Market using Machine Learning model i.e.,
Support Vector Machine (SVM) by RBF kernel.In this project we use four features to predict
stock price direction – price volatility, price momentum, sector volatility, and sector momentum.

Steps for Stock Market Prediction:-


Step 1: This step is important for the download data from the net. We are predicting the
financial market value of any stock. So that the share value up to the closing date are
download from the site.
Step 2: In the next step the data value of any stock that can be converted into the CSV
file (Comma Separate Value) so that it will easily load into the algorithm.
Step 3: In the next step in which GUI is open and when we click on the SVM button it
will show the window from which we select the stock dataset value file.
Step 4: After selecting the stock dataset file from the folder it will show graph Stock
before mapping and stock after mapping.
Step 5: The next step algorithm calculated the log2c and log2g value for minimizing
error. So, it will predict the graph for the dataset value efficiently.
Step 6: In final step algorithm display the predicted value graph of select stock which
shows the original value and predicted value of the stock.
RESULTS:-
CONCLUSION :-
In the project, we proposed the use of the data collected from
different global financial markets with machine learning
algorithms in order to predict the stock index movements. SVM
algorithm works on the large dataset value which is collected
from different global financial markets. Also, SVM does not
give a problem of over fitting. Various machine learning based
models are proposed for predicting the daily trend of Market
stocks. Numerical results suggest the high efficiency. The
practical trading models built upon our well-trained predictor.
The model generates higher profit compared to the selected
benchmarks.

You might also like