
Stock Market Prediction Using Machine Learning Final report of project 2 Submitted by KISHAN GIRI (1613101333/16SCSE101616) in partial fulfillment for the award of the degree of BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE AND ENGINEERING SCHOOL OF COMPUTING SCIENCE AND ENGINEERING Under the Supervision of M. Vivek Anand Assistant Professor. APRIL/MAY-2020 SCHOOL OF COMPUTING AND SCIENCE AND ENGINEERING BONAFIDE CERTIFICATE Certified that this projectreport “STOCK MARKET PREDICTION USING MACHINE LEARNING” is the bonafide work of “KISHAN GIRI(1613101333)” who carried out the project work under my supervision. SIGNATURE OF HEAD SIGNATURE OF SUPERVISOR Dr. MUNISH SHABARWAL, M.VIVEK ANAND , M.Tech. PhD (Management), PhD (CS) Assistant Professor Professor & Dean, School of Computing Science & School of Computing Science & Engineering Engineering Abstract: The main objective of this project is to find the best model to predict the value of the stock market. During the process Of considering various techniques and variables that must be taken into account, we found out that techniques like random forest, support vector machine were not exploited fully. In, this paper we are going to present and review a more feasible method to predict the stock movement with higher accuracy. The first thing we have taken into account is the dataset of the stock market prices from previous year. The dataset was pre-processed and tuned up for real analysis. Hence, our paper will also focus on data preprocessing of the raw dataset. Secondly, after pre- processing the data, we will review the use of random forest, support vector machine on the dataset and the outcomes it generates. In addition, the proposed paper examines the use of the prediction system in real-world settings and issues associated with the accuracy of the overall values given. The paper also presents a machine-learning model to predict the longevity of stock in a competitive market. The successful prediction of the stock will be a great asset for the stock market institutions and will provide real-life solutions to the problems that stock investors face.Case description: Support Vector Machines (SVM) and Artificial Neural Networks (ANN) are widely used for prediction of stock prices and its movements. Every algorithm has its way of learning patterns and then predicting. Artificial Neural Network (ANN) is a popular method which also incorporate technical analysis for making predictions in financial markets. Discussion and evaluation: Most common techniques used in the forecasting of financial time series are Support Vector Machine (SVM), Support Vector Regression (SVR) and Back Propagation Neural Network (BPNN). In this article, we use neural networks based on three different learning algorithms, i.e., Levenberg- Marquardt, Scaled Conjugate Gradient and Bayesian Regularization for stock market prediction based on tick data as well as 15-min data of an Indian company and their results compared. Conclusion: All three algorithms provide an accuracy of 99.9% using tick data. The accuracy over 15-min dataset drops to 96.2%, 97.0% and 98.9% for LM, SCG and Bayesian Regularization respectively which is significantly poor in comparison with that of results obtained using tick data. TABLE OF CONTENTS Title Page No. Certificate 2 Abstract 3 Chapter 1 Introduction 1.1 Scope Of Project 5 1.2 Problem Statement 6 Chapter 2 Overview Of Methodes used 7 2.1 Data Collection 8 2.1.1. Pre-processing 8 2.1.2. Training the Machine 9 2.1.3. Data Scoring 9 2.1.4 PROPOSED SYSTEMTITLE PAGE 9-10 No. Table 1. 1 2.2 Methodology(UsingExperimental Result LSTM) 14 10-14 Table 3.3 2.3 MethodologyK.Nearest Neighbours2. 28 14-16 2.3.1 SOFTWARE SPECIFICATION REQUIREMENTS: 16 Chapter 3 Understanding the problem statement and Implementation 3.1 Source Code 17 3.2 K.Nearest Neighbours 17-27 3.3 Implementation 27-36 Chapter 4 Result 37-38 4.1 Inference 38 4.2 LSTM 39 4.2.1 Implementation 39-43 Chapter 5 Conclusion and Future work 45 References 46 LIST OF TABLES LIST OF FIGURES TITLE PAGE No. Figure 2.1.1 Per-processing 10 Figure 2.2 Methodology (LSTM) 11 Figure 2.2.1 Random Forest Model 11 Figure 2.2.2 Data point graph 11 Figure 2.2.3 Data Point Graph 11 Figure 2.2.4 Data Point Graph 12 Figure 2.2.5 Data Point Graph 12 Figure 2.3.1 Neural Network Structure 15 Figure 2.3.2 Flow Chart of LM Algo 15 CHAPTER 1 Introduction 1.1 SCOPE OF THE PROJECT The stock market is basically an aggregation of various buyers and sellers of stock. A stock (also known as shares more commonly) in general represents ownership claims on business by a particular individual or a group of people. The attempt to determine the future value of the stock market is known as a stock market prediction. The prediction is expected to be robust, accurate and efficient. The system must work according to the real-life scenarios and should be well suited to real-world settings. The system is also expected to take into account all the variables that might affect the stock's value and performance. There are various methods and ways of implementing the prediction system like Fundamental Analysis, Technical Analysis, Machine Learning, Market Mimicry, and Time series aspect structuring. With the advancement of the digital era, the prediction has moved up into the technological realm. The most prominent and [3] promising technique involves the use of Artificial Neural Networks, Recurrent Neural Networks, that is basically the implementation of machine learning. Machine learning involves artificial intelligence which empowers the system to learn and improve from past experiences without being programmed time and again. Traditional methods of prediction in machine learning use algorithms like Backward Propagation, also known as Backpropagation errors. Lately, many researchers are using more of ensemble learning techniques. It would use low price and time lags to predict future highs while another network would use lagged highs to predict future highs. These predictions were used to form stock prices. Stock market price prediction for short time windows appears to be a random process. The stock price movement over a long period of time usually develops a linear curve. People tend to buy those stocks whose prices are expected to rise in the near future. The uncertainty in the stock market refrain people from investing in stocks. Thus, there is a need to accurately predict the stock market which can be used in a real-life scenario. The methods used to predict the stock market includes a time series forecasting along with technical analysis, machine learning modeling and predicting the variable stock market. The datasets of the stock market prediction model include details like the closing price opening price, the data and various other variables that are needed to predict the object variable which is the price in a given day. The previous model used traditional methods of prediction like multivariate analysis with a prediction time series model. Stock market prediction outperforms when it is treated as a regression problem but performs well when treated as a classification. The aim is to design a model that gains from the market information utilizing machine learning strategies and gauge the future patterns in stock value development. The Support Vector Machine (SVM) can be used for both classification and regression. It has been observed that SVMs are more used in classification based problem like ours. The SVM technique, we plot every single data component as a point in n- dimensional space (where n is the number of features of the dataset available) with the value of feature being the value of a particular coordinate and, hence classification is performed by hyperplane that differentiates the two classes explicitly. A stock market is a platform for trading of a company’s stocks and derivatives at an agreed price. Supply and demand of shares drive the stock market. In any country stock market is one of the most emerging sectors. Nowadays, many people are indirectly or dir- ectly related to this sector. Therefore, it becomes essential to know about market trends. Thus, with the development of the stock market, people are interested in forecasting stock price. But, due to dynamic nature and liable to quick changes in stock price, predic- tion of the stock price becomes a challenging task. Stock markets are mostly a non-parametric, non-linear, noisy and deterministic chaotic system (Ahangar et al. 2010). As the technology is increasing, stock traders are moving towards to use Intelligent Trading Systems rather than fundamental analysis for predicting prices of stocks, which helps them to take immediate investment decisions. One of the main aims of a trader is to predict the stock price such that he can sell it before its value decline, or buy the stock before the price rises. The efficient market hypothesis states that it is not possible to predict stock prices and that stock behaves in the random walk. It seems to be very difficult to replace the professionalism of an experienced trader for predicting the stock price. But because of the availability of a remarkable amount of data and technological advancements we can now formulate an appropriate algorithm for pre- diction whose results can increase the profits for traders or investment firms. Thus, the accuracy of an algorithm is directly proportional to gains made by using the algorithm. 1.2 PROBLEM STATEMENT The existing system fails when there are rare outcomes or predictors, as the algorithm is based on bootstrap sampling . The previous results indicate that the stock price is unpredictable when the traditional classifier is used. The existence system reported highly predictive values, by selecting an appropriate time period for their experiment to obtain highly predictive scores.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages47 Page
-
File Size-