ISSN ONLINE(2320-9801) PRINT (2320-9798)

All submissions of the EM system will be redirected to Online Manuscript Submission System. Authors are requested to submit articles directly to Online Manuscript Submission System of respective journal.

Prediction Using Back Propagation and k- Nearest Neighbor (k-NN) Algorithm

Tejaswini patil, Karishma patil, Devyani Sonawane, Chandraprakash
Student, Dept. of computer, SSBT COET, North Maharashtra University, Jalgaon, Maharashtra, India
Related article at Pubmed, Scholar Google

Visit for more related articles at International Journal of Innovative Research in Computer and Communication Engineering


Prediction of Stock Prices is not only inquisitiveness but also the very challenging topic. This paper intension is predict stock prices for sample of some major companies using back propagation and k-nearest neighbor algorithm, to help out executive, investors, user and choice makers in making valuable decisions. Stockpile market give lots of profit or benefit with low risk because it is treating as memorable field. For business researchers and data mining the stock market is most suitable environment because of its large and continually changing information. Predicting stock price with traditional time it has been proven easier done. An artificial neural network might be more compatible for task primarily because, neural network is more calibers to predict stock prices more accurate than current using technique. It also takes out huge amount of information from different sources. We have study architecture of neural network. We will build best model by analyzing various parameter of neural network and also study supplementary model to compare accuracy of model in terms of error rate price, turnover as input. Input is previous stock data and output is future stock price prediction.


Companies data, data mining, k-NN, neural network, prediction, stock prices.


Stock market price prediction is an interesting topic for research purposes as well as marketable field, in many developed country power cost-cutting measure is used to map economies. A well recognized technique and school of effects counting necessary and technical analysis, has developed in up to date decades. However, all these technique and apparatus are fully depended on different approaches. Those all apparatus or analytical tool are whole depend on human proficiency and justice in area such as continuation patterns, inclination prediction, promote pattern. People spend in market based on some investigation, numerous investors or researchers choice concentrated on area of stock price prediction which is tricky and difficult. While devoting in market people try to find better device and technique for how would they increase their profit with less risk. Data, primary analysis, technical analysis are all used to go to predict and profits from markets trend. Complex event process is processing system which has capability to extract multiple statistics from different source. Investors, business researchers, user who assume that future event of prediction are fully depend on current and past data. However, financial statistics are hard to predict. Prediction of prices is seen to be intricate and efficient market hypotheses explained (EMH) it that was lay in (1990). Efficient market hypotheses fill the gap between financial market and financial information, it also shows that fluctuations in price are only result of new available data and that reflect in stock price. Stock price prediction need previous data, it can’t be random.
Stock price continually changes because of constantly changing attitude of investors due to different services such as volume, using price, interest etc. All these accommodate in technical analysis, according to technical analysis history repeats itself so that’s why future price is near close to previous price. It show chart to predict future price. By analysis the performance of company and abundance can determine the share price, and that involve in fundamental analysis. It has many advantages one of them that it shows changes before it show on charts. This analysis assume that shares current and future price depend on essential value and probable return on savings.
Expected return on company’s share will change because new statistics released pertaining to the company’s status, which influence the stock prices.


Many investors or researchers claim that the stock market is a chaos system. Chaos is a non linear deterministic system which only appears arbitrary because of its asymmetrical fluctuations. Investors, business researchers invest in the stock market based on some scrutiny. As the level of investing and trading grew, people explore for tools and methods that would increase their gains while reducing their threat. Stockpile market give lots of profit or benefit with low risk because it is treating as memorable field.
The genetic algorithm had been adopted by Shin (et al. 2005); the number of trading rules was generated for Korea Stock Price Index 200 (KOSPI 200), in Sweden Hellestrom and Homlstrom (1998) used a geometric scrutiny based on a made to order k-NN to establish where associated fields plunge in the input space to progress the performance of prediction for the period 1987-1996. Clustering stocks approach was provided by Gavrilov et al.


User, researchers, business communities not only purchase or buy and sell stocks and share in market by considering only its price but also by another variable such as its close price which play the vital role to predict price of ahead days for that specific stock. There is all relationship among all variable that reflect the result in continually changing stock movement.
Structural design of stock prediction depict in following figure:
a. Information collection
Information collection play major role in prediction it collect data from different sources that is dated, it contain opening and closing price also with high, low, average price. Before apply collected data modeling on time series data should be make cleaned because most of the time original information contain noise and redundant data that will influence the correct prediction results. Data preparation involve item such as filter, transformation. Integration process used to obtain optimal subset.
b. engine learning
Aggregated result will compared to business threshold in this phase, in this phase data driven approaches will explore for more bendable, vibrant way to spot events and determine required action.
c. parameter selection
 Find out size of training and testing data.
 Determine no. of close neighbor
 Back propagation and k-NN algorithm.
 Input, hidden, and output node.
 Find out learning rate.
 Find out number of steps.

B. k-Nearest Neighbor

K-NN algorithm is easy to implement this is a machine (engine) learning technique. K-NN algorithm is more robust and stable give correct result with small error ratio. The past stock data and taxing information is mapped into set of vectors. Every vector represent N dimension for each stock feature. K-Nearest Neighbor algorithm is assumed as indolent because it does not construct form. Using this algorithm we will have close result of price prediction of shares.


Stock price prediction result for the following company as sample with graph for actual and future price predicted. The final result is seen in table 1 and 2 after applying the back propagation and k-NN algorithm for some company that shows how much difference between actual value from predicted value.
Predicted value such as closing prices, high prices and low prices after applying k-NN algorithm is shown in Table 3. 200 records from the period are selected as the training dataset and only some records future stock value are shown in the table. Closing price consider as main aspect that affects the prediction process for exact stock based on k-NN algorithm. Negative value indicate that predicted value is greater than actual one.
Comparison chart shows the predicted value in standard stacked column or it can be show in lift chart which make investor easy to understand what would be actual price.


Prediction of stock price using back propagation and k-NN algorithm is based on real time market prediction. Robust model has constructed, so prediction price is close to actual price. Stock price predicted with moderate accuracy. The system will be more useful for those people who used to give attention to invest their money in stock it will give them right path which stock will have more value. K-NN is viable and real for stock prediction.


1. Amit ganatr, Y.P. Kosta. “spiking back propagation multilayer neural network design for predicting unpredictable stock market price with time series analysis” International journal of computer of theory and engineering, vol. 2, no. 6, December 2010, 1893-8201.

2. Khlid alkhatib, Hassan najadat, ismail hmeidi, Mohammad k.ali shatnawi. “Stock price prediction using k-nearest neighbor algorithm”, international journal of business, humanities and technology. Vol.3, no. 3, march 2013.

3. Prakash Ramani, Dr. P.D. Murarka “Stock Market Prediction Using Artificial Neural Network”, International Journal of Advanced Research in Computer Science and Software Engineering, Volume 3, Issue 4, April 2013.

4. Zabir Haider Khan, Tasnim Sharmin Alin, Md. Akter Hussain “Price Prediction of Share Market using Artificial Neural Network (ANN)” International Journal of Computer Applications (0975 – 8887) Volume 22– No.2, May 2011.

5. Leavit and Neal “complex event processing poised for growth”, International journal of science and enginnering research, computer vol. 42 no. 4. PP 17-20. Washington, April 2009.

6. Ramon Lawrence, “Using Neural Networks to Forecast Stock Market Prices”, Course Project, University of Manitoba Dec. 12, 1997.