Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
79 views

Python Mini Project

This document discusses predicting the stock price of Apple Inc. It begins by providing background on stocks and shares as investments. It then defines the problem of predicting stock prices, which are unpredictable and influenced by many changing internal and external factors. The purpose of the project is to use machine learning algorithms to predict Apple's stock price over the next three days based on historical data. It outlines limitations of existing stock prediction systems, such as being limited in their learning ability and prone to data loss. The proposed system aims to address these issues by considering multiple influencing constraints, monitoring predictions, and using more flexible training and testing of models.

Uploaded by

K Abhijith Nayak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Python Mini Project

This document discusses predicting the stock price of Apple Inc. It begins by providing background on stocks and shares as investments. It then defines the problem of predicting stock prices, which are unpredictable and influenced by many changing internal and external factors. The purpose of the project is to use machine learning algorithms to predict Apple's stock price over the next three days based on historical data. It outlines limitations of existing stock prediction systems, such as being limited in their learning ability and prone to data loss. The proposed system aims to address these issues by considering multiple influencing constraints, monitoring predictions, and using more flexible training and testing of models.

Uploaded by

K Abhijith Nayak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Apple.

inc Stock Price Prediction

CHAPTER 1

INTRODUCTION
1.1 INFORMATION ON STOCK

We all have heard the word stock one way or the other. Particularly stock is related
with the associates and companies which are commercialized and are to settling in the world
of marketization. The other word used for stock is share which is prominently used in day-
to-day life. People even term is as an investment plan and it’s something people see as a
long-term investment that secures and provides an abundant funds during the retirement
age.
Buying a company stock is purchasing a small share of it. People invest on the same
to get a long-term benefit which they think is less value for now but has to potential to grow
with the time. It’s an investment that provides the long time run and deals with long time
goals with the fair objectives. The value of share you invest today has to give you a yield of
best tomorrow but it’s not the same.
Market is unpredictable so are the resources and the factors that are taken to drive it off or
on the set. It’s never been on the same level and the pattern of the same is still
unpredictable till the time. Some closeness and prediction method had been derived and
approximates values and the rough figures are generated hoping for the best but all of the
resource can’t be trusted and are still unpredictable in nature.
Knowing the market situation and researching on the same is the best way to find
the reliability for which there are many agents who have taken the same as a profession and
are making a fortune out of it. They predict and advise but the advisory cost and the charge
is higher and the stock evaluation is never less the same.
Market is changing in an instantaneous rate even in a day there are many highs and lows in
the market and having said the resources and the timing the external and internal agent.
Stock is a fascinating resource to start with.

Department of MCA Page 1


Apple.inc Stock Price Prediction

1.2 PROBLEM DEFINITION

Stock is an unpredictable curve that had been in picture ever since. Its essence had
been ever long living and indulging. It had grown its popularity with respect to time. People
are more fascinating and interested on the same then before times. Same for the case for the
organization. Organization had created it as a better source of revenue generation rather than
investing and taking a loan approval from the bank It's way efficient and less hectic from the
firm point of view.
Stock is unpredictable and it’s been the same from the start. Its way of escalating
and deescalating had been phenomenon and experiencing the same is the best integral part
of it. It has its upper hand and flexibility with the changes that has the chances of uprising as
well as crashing the whole market. Its easily defined in few words but making an essence
and understanding the same is way more hectic and time consuming.
Simpler it sound complex are its phenomenon and integrating the same. It’s having
its whole different sets of dependencies and integration from different agents which
fluctuate the same in the market. Finding an accurate and getting the exact values out of
the same is still unaligned and no particular model of the same is seen in the market value.
Finding the closest and getting an accurate proximate value out of such an
unpredictability is a problem in itself. Merging of the data getting the best prediction to
increase the efficiency alongside considering the different expects of the moderator is tough
and we took the same in consideration and implemented with every aspect to generate the
best out of the same and get a result that can be better interrupted and the efficiency
remains the same with the value of different aspects of creating an impact of reducing the
risk and influencing the same over the time period to gain the most out of it.
This is totally based on Machine Learning Algorithm to proceed and provide an
effective result. Getting the data and processing it and generating a forecast for three days is
the problem statement that we worked on.

Department of MCA Page 2


Apple.inc Stock Price Prediction

1.3 PROJECT PURPOSE

Stock market prediction is a prediction system software that illuminate the risk that
undergoes during the investment in stock market. It predicts the stock rates and its rate of
exchange acknowledging the basic understanding and the statistical analysis in front of
users.
Data is considered as the digital fuel that gives the possibilities of higher yearn and
gives the upcoming terms. Knowledge is power and same holds correct with the stock.
Stock is unpredictable and over-changing its dynamic in nature. The rise and fall of the
same is uneven and can’t be classified so easily. Dependencies of the same deals with
flexible resources and the agents behind it.
Investment during a fiscal day determines the opening stock market for the next day.
It has its dependencies and is total integration with the level of finances and revenue
generation. The stock is tremendous and hectic in nature. The main theme of the project is
to predict the turning curves and bring the predictability method and undergo the process
and algorithms to conclude to a viable resource source.
Everything flows a pattern. Pattern is the way of derivation and so holds true for the
stock too. Stock in day-to-day life follows a pattern movement. Increase in some resource
can increase the price of some whereas decrease the price rate for the others, The source and
the outcome are derived on the polarity basis which can either be positive, neutral or a
negative flow. Correlation of the given polarity is determined and an effective source and
reliability is established.
This project helps in bridging the resources and empowering the people to know and
trade the most out of stock and understand the generation and the vulnerabilities that has to
be seen and predicted. The enhancement of the same is done with the resource graph which
makes a user or the customer to analyses the same and take the needs and important details
before dealing and consider those things for the yield that the person is willing to invest on.
Forecasting of the stock prediction is done by the available data source and the prediction is
done for the upcoming week. The predictability itself is a challenge and that’s the main
purpose of the report.

Department of MCA Page 3


Apple.inc Stock Price Prediction

1.4 EXISTING SYSTEM

As many have invested their time and effort in this world trade for getting it closer
and more reliable to the people for carrying out the resources and make their lifestyle more
deliberate than the previous. In the past few years various strategies and the plans had been
derived and deployed ever since it’s continuation and the topic is still a point of research
where people are coming up with ideas to solve.

Intelligence fascinates mankind and having one in machine and integrating on the
same is the hot key of research. There are various people contributing on the same research.
As he tried its invention on two non-linear process and had come up with TS which is used
as a model for fuzzy sets.

All the learning system from the past are limited and are simplest in nature where
learning of the simple algorithm for a computational mean is not enough which can even be
done by human brain itself. The main motto of learning was limitized and learning model
was not efficient.

The existing models can’t cope up with the vulnerabilities and remove the rarest
information that they can’t process causing it a major data loss which creates a problem in
forecasting.

Observation is the integral part in the resource and prediction management. If the
outcome can’t be observed it’s point of time estimation is compromised causing it less
liable in market. Monitoring of the same is not possible in the existing system.

The existing system in stock market predictions are apparently biased because it
considers an only source point for data source. Before the prediction of the data set a simple
data retrieval should be generated and tested on the training data set which are more flexible
and versatile in nature.

Loss of sights is a major problem in the existing system as the stock varies each days
and the loss margin can be higher with respect to time. An initial instance is taken for
prediction.

Department of MCA Page 4


Apple.inc Stock Price Prediction

1.5 PROPOSED SYSTEM

Stock is unpredicted and liberal in nature. The follow of the same is impressive and
reluctant in nature. Finding the predictability and getting the nearest is the best hit goal for
the same. The exact and accurate estimation of the same is never-less possible.

There are various constrains that in-fluctuate the pricing and the rate of stock. Those
constrains had to be taken in consideration before jumping to the conclusion and report
derivation.

Fig 2.4: System Flow

Here as described in the figure above, the proposed system will have an input from
the dataset which will be extracted featured wise and Classified underneath. The
classification technique used is supervised and the various techniques of machine level
algorithms are implemented on the same.
Training Dataset are created for training the machine and the test cases are derived
and implemented to carry out the visualization and the plotting’s. The result generated are
passed and visualized in the graphical

Department of MCA Page 5


Apple.inc Stock Price Prediction

CHAPTER 2

LITERATURE SURVEY

One of the integral parts to maintain the consistency is the literature survey. It’s the
crucial steps to be followed in the development process. [1] The Software Development
needs authenticity of the resources and the availability of the same. This part helps in
discovering the content that been worked on and find the utilization and the implementation
of the same in today’s time. The key factor to the development is the economy and the
strength of the product. [2] Once the innovation of the same undergoes through the building
phase the support and the resource flow is to be monitored and computed. This is also known
as the Research phase where all the research is embedded and done to carry the flow.

2.1 JUPYTER NOTEBOOK

Jupiter Notebook or so called IPython Notebook is an interactive web based


computational mean for starting with Jupiter Notebook documents. The term notebook itself
is a huge entity to represent the integration with different entity sets. JSON is the main
document form from the same for the execution which follows the brief on the schema and
the input and output means. It has high integration with several language set and has various
flexibilities with the choices.
The extension used for the same is “. ipynb” which runs in this platform. It’s an open-
source software package with interactive communication means. It has its open standards for
the same. It’s an open community best for budding programmers. The flexibility of the same
is phenomenon and splendidly done the configuration and integration of the same is simplest
and easy on hold so that no prior distortion is generated and the efficiency of the same is
measured throughout any system of choice. It’s the best software sets that been used across
cross for designing and developing of the products and support wide help support.
Not only to that, it provides scalability in the code and the deployment of the same.
Various Language can be changed and the project can be undertaken on the same. The
created notebook files can be shared and stored in various means for further utilization.

Department of MCA Page 6


Apple.inc Stock Price Prediction

CHAPTER 3

REQUIREMENT ANALYSIS

3.1 FUNCTIONAL REQUIREMENTS

Functional requirements deal with the functionality of the software in the


engineering view. The component flow and the structural flow of the same is enhanced and
described by it.
The functional statement deals with the raw datasets that are categorized and
learning from the same dataset. Later the datasets are categorized into clusters and the
impairment of the same is checked for the efficiency purpose. After the dataset cleaning the
data are cleansed and the machine learns and finds the pattern set for the same it undergoes
various iteration and produce output.

3.2 NON-FUNCTIONAL REQUIREMENTS

Non-functional requirement deals with the external factors which are non- functional
in nature It is used for analysis purpose. Under the same the judgment of the operations is
carried out for its performance. Stock is feasible and is ever changing so these extra effects
and the requirements helps it to get the latest updates and integrate in a one goes where the
technicians can work on and solve a bug or a draft if any.
The non-functional requirements followed are its efficiency and hit gain ratio. The
usability of the code for the further effectiveness and to implement and look for the security
console. The System is reliable and the performance is maintained with the support of
integration and portability of the same.

Department of MCA Page 7


Apple.inc Stock Price Prediction

Chapter 4

SOFTWARE REQUIREMENTS SPECIFICATION

• Problem requirement analysis


• Requirement specification

Problem requirement Analysis The process is order and more nebulous of the two,
ideas with understanding the problem, the goals is to full fill the constraints posed by the
client.

Requirement specification Here the focus is on specifying what has been found in the
process of analysis such as representation, specification languages and tools and also
checking the specification are addressing during the activity. The requirement phase
terminates with the production of the validate SRS document, producing SRS document is
thebasic goals of this phase.

Role of software requirement specification (SRS) The purpose of the software


requirement specification is to reduce the communication gap between the clients and
developers.

Software requirement specification is the medium through which the clients and
users’ needs are accurately specified. It forms the basis of software development. SRS
shouldspecify all the parties and operations involved in the system.

Department of MCA Page 8


Apple.inc Stock Price Prediction

4.1 HARDWARE REQUIREMENTS

Processor : Intel i5 or above

RAM : Minimum 225MB or more

Hard Disk : Minimum 2 GB of space

Input Device : Keyboard

Output Device : Screens of Monitor or a Laptop

4.2 SOFTWARE REQUIREMENTS

Operating system : Windows & Linux

IDE : Jupiter Notebook

Data Set : aapl.csv file

Visualization : mat plot lib, pandas.

Server : Web Server with HTTP process.

Department of MCA Page 9


Apple.inc Stock Price Prediction

CHAPTER 5
DATA COLLECTION
Data collection is the process of gathering and measuring information on
variables of interest, in an established systematic fashion that enables one to answer
stated research questions, test hypotheses, and evaluate outcomes.
Data collection enables a person or organization to answer relevant questions,
evaluate outcomes and make predictions about future probabilities and trends.

We collect data through the Kaggle dataset, Kaggle allows users to find and
publish data sets, explore and build models in a web-based data-science environment,
work with other data scientists and machine learning engineers, and enter competitions
to solve data science challenges

Kaggle supports database files using the lightweight SQLite format. SQLite
databases consist of multiple tables, each of which contains data in tabular format.
These tables support large datasets better than CSV files do, but are otherwise similar in
practice.

Our dataset consists of six columns in total, they are namely


”Date”,”Close/Las”,”Volume”,”Open”,”High”,”Low”. total of 2519 rows.

Department of MCA Page 10


Apple.inc Stock Price Prediction

CHAPTER 6

DESIGN
DESIGN GOALS

To make the project runs smoothly it’s required that we make plan and design

some accepts like flowcharts and system architecture which are defined below.

Data Collection

Data collection is one of the important and basic things in our project. The right
dataset must be provided to get robust results. Our data mainly consists of previous year or
weeks stock prices. We will be taking and analyzing data from Kaggle. After that seeing
the accuracy, we will use the data in our model.

Data Pre-processing

Human can understand any type of data but machine can’t our model will also learn
from scratch so it’s better to make the data more machine readable. Raw data is usually
inconsistent or incomplete. Data preprocessing involves checking missing values, splitting
the dataset and training the machine etc.

Training Model

Similar to feeding somethings, machine/model should also learn by feeding and


learning on data. The data set extracted from Kaggle will be used to train the model. The
training model uses a raw set of data as the undefined dataset which is collected from the
previous fiscal year and from the same dataset a refine view is presented which is seen as
the desired output. For the refining of the dataset various algorithms are implemented to
show the desired output.

Department of MCA Page 11


Apple.inc Stock Price Prediction

6.1 SYSTEM ARCHITECTURE

The dataset we use for the proposed project is been taken from Kaggle. But this data
set is in raw format. The data set is a collection of valuation of stock market information
about some companies. The initial step is to convert raw data into processed data. Which is
done by feature extraction, since the raw data collected have multiple attributes but only
some of those attributes are needed for the prediction. Feature extraction is a reduction
process.
The structure, behavior and views of a system is given by structural model.

Fig 4.1: System Architecture


The above figure 4.1 gives the demonstration on the dataset extraction and refining
the raw dataset by categorizing into two phases of training and testing data. From the given
dataset a well modified categorization is extracted and a graph set is plotted to gain the
required output which gives the stock prediction range.

Department of MCA Page 12


Apple.inc Stock Price Prediction

6.2 USE CASE DIAGRAM

A dynamic and behavioral diagram in UML is use case diagram. Use cases are
basically set of actions, services which are used by system. To visualize the functionality
requirement of the system this, use case diagram are used. The internal and external events
or party that may influence the system are also picturized. Use case diagram specify how the
system acts on any action without worrying to know about the details how that functionality
is achieved.
For the project we have created the below mentioned use case diagram.

Fig 4.2: Use Case Diagram

The above figure 4.2 shows the use-case diagram of the entitled project and its flow.
From the diagram it’s seen that the user gives the raw dataset as input and with the flow of
the input in the system.
The system evaluates and process the dataset train itself with the provided dataset and
extract the meaningful dataset to process and refine the cluster data and from the given
cluster of the data, the plotting of the data values are shown and with the given range the
system plots the data gives a figurative output as prediction and display the same as the
refined output in the display screen.
Department of MCA Page 13
Apple.inc Stock Price Prediction

6.3 DATA FLOW DIAGRAM

Fig 4.3 Data Flow Diagram

In the above fig 4.3 we are taking a company fetching the data of the company from
the panda’s data-reader library then we are plotting the data, then we train the data to predict
the stock for certain number of days. In this way data is flowing in our system.

Department of MCA Page 14


Apple.inc Stock Price Prediction

CHAPTER 7
IMPLEMENTATION

These are the Machine Learning Algorithms implemented during the building
of theproject.
7.1 LINEAR REGRESSION
One of the well-known algorithms used in machine learning is the linear
regression. It is covered under both statistical as well as in machine learning. It is used
for analyzing the dependency between two variables one is known dependency which
value is known and the other is unknown. The value of the unknown dependency is
checked with the known dependencies and the result is found ad derived on its basis.
The dependency of the variable chances and are categorized into two types.
Positive Linear Regression is the regression flow when both the dependencies show the
growth rate and both are totally depended and supportive with the changes flow. Negative
Regression is the regression flow where one dependency cancels the growth of the other.
If one dependency shows the tendency to grow whereas the other one is decreasing then
this graph flow comes in picture.
They are Single Linear Regression (SLR), it’s the fundamental block of linear
regression. It assumes that the two dependencies are linearly aligned and changing the
values on the same will affect the other equally.
Multi Linear Regression is an extension of the SLR algorithm here different
fundaments are considered with regards to the dependencies. It even deals with residual
errors.

Department of MCA Page 15


Apple.inc Stock Price Prediction

7.2 LONG SHORT-TERM MEMORY(LSTM)

Sequence prediction problems have been around for a long time. They are
considered as one of the hardest problems to solve in the data science industry. These
include a wide range of problems; from predicting sales to finding patterns in stock
markets’ data, from understanding movie plots to recognizing your way of speech, from
language translations to predicting your next word on your iPhone’s keyboard.

With the recent breakthroughs that have been happening in data science, it is found
that for almost all of these sequence prediction problems, Long Short-Term Memory
networks, LSTMs have been observed as the most effective solution.

LSTMs have an edge over conventional feed-forward neural networks and RNN in
many ways. This is because of their property of selectively remembering patterns for long
durations of time. The purpose of this article is to explain LSTM and enable us to use it in
real life problems.

LSTMs on the other hand, make small modifications to the information by


multiplications and additions. With LSTMs, the information flows through a mechanism
known as cell states. This way, LSTMs can selectively remember or forget things. The
information at a particular cell state has three different dependencies. Industries use them to
move products around for different processes. LSTMs use this mechanism to move
information around.

We may have some addition, modification or removal of information as it flows


through the different layers, just like a product may be molded, painted or packed while it
is on a conveyor belt.

Department of MCA Page 16


Apple.inc Stock Price Prediction

7.3 PYTHON CODE

import pandas as pd
data = pd.read_csv("C:\\Users\\Abhijith Nayak K\\Desktop\\Python project\\aapl.csv")
df = pd.DataFrame(data)
df.head()
df1=df.reset_index()['close']
df1
import numpy as np
from sklearn.preprocessing import MinMaxScaler
scaler=MinMaxScaler(feature_range=(0,1))
df1=scaler.fit_transform(np.array(df1).reshape(-1,1))
training_size=int(len(df1)*0.65)
test_size=len(df1)-training_size
train_data,test_data=df1[0:training_size:],df1[training_size:len(df1):1]
import numpy
def create_dataset(dataset,time_stap=1):
dataX,dataY = [],[]
for i in range(len(dataset)-time_step-1):
a=dataset[i:(i+time_step),0]
dataX.append(a)
dataY.append(dataset[i+time_step,0])
return numpy.array(dataX), numpy.array(dataY)
time_step=100
X_train,Y_train=create_dataset(train_data,time_step)
X_test,Y_test=create_dataset(test_data,time_step)
from sklearn.linear_model import LinearRegression
# model training
model_1 = LinearRegression()

Department of MCA Page 17


Apple.inc Stock Price Prediction

model_1.fit(X_train, Y_train)
Acc = []
Y_pred_1 = model_1.predict(X_test)
y_pred_2 = model_1.predict(X_test)
pred_df = pd.DataFrame({'Actual': Y_test, 'Predicted': Y_pred_1})
pred_df.head()
from sklearn.metrics import r2_score

print("Accuracy score of the predictions: {0}".format(r2_score(Y_test, Y_pred_1)))


Acc.append(r2_score(Y_test, Y_pred_1))
from matplotlib import pyplot as plt
plt.figure(figsize=(8,8))
plt.ylabel('Close Price', fontsize=16)
plt.plot(pred_df)
plt.legend(['Actual Value', 'Predictions'])
plt.show()

#lstm model

close = df.reset_index()['close']
close.head()
import numpy as np
from sklearn.preprocessing import MinMaxScaler
scaler=MinMaxScaler(feature_range=(0,1))
df1=scaler.fit_transform(np.array(df1).reshape(-1,1))
training_size=int(len(df1)*0.65)
test_size=len(df1)-training_size
train_data,test_data=df1[0:training_size:],df1[training_size:len(df1):1]
import numpy

Department of MCA Page 18


Apple.inc Stock Price Prediction

def create_dataset(dataset,time_stap=1):
dataX,dataY = [],[]
for i in range(len(dataset)-time_step-1):
a=dataset[i:(i+time_step),0]
dataX.append(a)
dataY.append(dataset[i+time_step,0])
return numpy.array(dataX), numpy.array(dataY)
time_step=100
X_train,Y_train=create_dataset(train_data,time_step)
X_test,Y_test=create_dataset(test_data,time_step)

from tensorflow.keras.models import Sequential


from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import LSTM
model=Sequential()
model.add(LSTM(50,return_sequences=True,input_shape=(100,1)))
model.add(LSTM(50,return_sequences=True))
model.add(LSTM(50))
model.add(Dense(1))
model.compile(loss='mean_squared_error',optimizer='adam')
model.fit(X_train,Y_train,validation_data=(X_test,Y_test),epochs=100,batch_size=64,verbos
e=1)
Y_pred = model.predict(X_test)
pred_df = pd.DataFrame({'Actual': Y_test, 'Predicted': Y_pred.flatten()})
pred_df.head()

# Measure the Accuracy Score

from sklearn.metrics import r2_score

Department of MCA Page 19


Apple.inc Stock Price Prediction

print("Accuracy score of the predictions: {0}".format(r2_score(Y_test, Y_pred)*100))


Acc.append(r2_score(Y_test, Y_pred))

plt.figure(figsize=(8,8))
plt.ylabel('Close Price', fontsize=16)
plt.plot(pred_df)
plt.legend(['Actual Value', 'Predictions'])
plt.show()
len(test_data)
x_input=test_data[341:].reshape(1,-1)
x_input.shape
temp_input=list(x_input)
temp_input=temp_input[0].tolist()
from numpy import array

lst_output=[]
n_steps=100
i=0
while(i<30):

if(len(temp_input)>100):
#print(temp_input)
x_input=np.array(temp_input[1:])
print("{} day input {}".format(i,x_input))
x_input=x_input.reshape(1,-1)
x_input = x_input.reshape((1, n_steps, 1))
#print(x_input)
yhat = model.predict(x_input, verbose=0)
print("{} day output {}".format(i,yhat))

Department of MCA Page 20


Apple.inc Stock Price Prediction

temp_input.extend(yhat[0].tolist())
temp_input=temp_input[1:]
#print(temp_input)
lst_output.extend(yhat.tolist())
i=i+1
else:
x_input = x_input.reshape((1, n_steps,1))
yhat = model.predict(x_input, verbose=0)
print(yhat[0])
temp_input.extend(yhat[0].tolist())
print(len(temp_input))
lst_output.extend(yhat.tolist())
i=i+1
print(lst_output)
day_new=np.arange(1,101)
day_pred=np.arange(101,131)

import matplotlib.pyplot as plt

plt.plot(day_new,scaler.inverse_transform(df1[1158:]))
plt.plot(day_pred,scaler.inverse_transform(lst_output))

Department of MCA Page 21


Apple.inc Stock Price Prediction

CHAPTER 8

TESTING

A test method which was performed was performed was explicit, unambiguous and
experimentally feasible as well as effective and reproductive. According to the inputs,
outputs has been produced. The purpose of testing is to get errors. Testing is that the process
of trying to get every conceivable fault or weakness during a work product. It provides how
to see the functionality of components, sub-assemblies, assemblies and/or a finished product
it's the method of exercising software with the intent of ensuring that the software meets its
requirements and user expectations and doesn't fail in an unacceptable manner. There are
various sorts of test. Each test type addresses a selected testing requirement. The various
types of testing that follows are listed as below.

8.1 UNIT TESTING

Unit testing involves the planning of test cases that validate that the interior program
logic is functioning properly, which program inputs produce valid outputs. All decision
branches and internal code flow should be validated. it's the testing of individual software
units of the appliance.
It is done after the completion of a private unit before integration. this is often a
structural testing, that relies on knowledge of its construction and is invasive. Unit tests
perform basic tests at component level and test a selected business process, application,
and/or system configuration.
Unit tests make sure that each unique path of a business process performs accurately
to the documented specifications and contains clearly defined inputs and expected results.

Department of MCA Page 22


Apple.inc Stock Price Prediction

8.2 INTEGRATION TESTING

Integration tests are designed to check integrated software components to work out
if they really run together program. Testing is event driven and is more concerned with the
essential outcome of screens or fields.
Integration tests demonstrate that although the components were individually
satisfaction, as shown by successfully unit testing, the mixture of components is correct and
consistent. Integration testing is specifically aimed toward exposing the issues that arise
from the mixture of components.

8.3 SYSTEM TESTING

System testing of software or hardware is testing conducted on an entire, integrated


system to gauge the system's compliance with its specified requirements. System testing
falls within the scope of recorder testing, and intrinsically, should require no knowledge of
the inner design of the code or logic.

As a rule, system testing takes, as its input, all of the "integrated" software
components that have successfully passed integration testing and also the software itself
integrated with any applicable hardware system(s).
System testing may be a more limited sort of testing; it seeks to detect defects both
within the "inter-assemblages" and also within the system as an entire.
System testing is performed on the whole system within the context of a Functional
Requirement Specification(s) (FRS) and/or a System Requirement Specification (SRS).
System testing tests not only the planning, but also the behavior and even the
believed expectations of the customer. it's also intended to check up to and beyond the
bounds defined within the software/hardware requirements specification(s).

Department of MCA Page 23


Apple.inc Stock Price Prediction

Test Case -1

Test Case number TC_01

Module Under Test Data Extraction

Description When the program is executed, it tries to


connect to downloaded dataset for using
the data source of the demanded
company.
Output If the connection details are correct, data is
extracted. If the details are incorrect, an
error is shown.

Remarks Test Successful.

Department of MCA Page 24


Apple.inc Stock Price Prediction

Test case-2

Test Case Number TC_02

Module Under Test Creating Test and Train data

Description We divide the extracted data into 2 parts


test and train data.

Input As per the requirement the data is given.

Output Inbuilt data dividers will distribute the


data.

Remarks Test Successful.

Department of MCA Page 25


Apple.inc Stock Price Prediction

CHAPTER 9

RESULT SNAPSHOT

Fig 9.1: Linear Regression

Fig 9.2: Predicted Graph

Department of MCA Page 26


Apple.inc Stock Price Prediction

Fig 9.3: LSTM

Department of MCA Page 27


Apple.inc Stock Price Prediction

CHAPTER 10

CONCLUSION AND FUTURE ENHANCEMENT

10.1 CONCLUSION

To conclude stock is an unpredictable mechanism which follows the segments of


chain and the dependencies of the same are unpredictable. It is defined to be a curve which
keeps on changing and turning the price from low to high and vice-versa.

As the integration of the same is higher with other dependencies so leaving one
dependency compromises the level of accuracy. Accuracy is not the term used over in stock
as the actual prediction is not possible for any fiscal days it keeps on changing and turning
the tables day and night. Having higher component assets and the dependencies makes it
more feasible and flexible in nature causing it even harder to predict. The approx. value are
taken into consideration and the hit or profit or the gain rate is calculated for the same.

In the project various high level machine learning algorithms are implemented and
integrated and the output is generated from the same making a user visible with the outputs
in the form of graph which makes it easier for them to see and interpret what’s the scenario
and they can decide on the same to invest and get the benefit out of it,

The proposed software takes the raw set of data from the dataset or the .csv file and
process it. The cleaning and cleansing of data is done and then further processed to gain the
effective outcomes. After the computational mean the output is displayed in the screen in
the form of graph.

Department of MCA Page 28


Apple.inc Stock Price Prediction

10.2 FUTURE ENHANCEMENT

Stock Market are the best alternative for business to grow and it’s a side way income
for the individuals who are ready to invest and earn from the same. The term stock had been
in picture ever since and it’s growing in bulk every day. There are thousands of investors
investing on the same and making the fortune out of it.

There are middle level agents and stock vendors who learn and invest on the same.
The cost for the consultation on the stock is bulky and expensive. So, when it comes to
people, they think a lot and invest and there’s no chance and certainty for the same to
produce a yieldful result.

So, stock being unpredictable and the tendency of its growth is higher than ever. If
the stock market and its prediction can be done accurate than it’s going to be a gain for both
the individuals and the organization. The risk factor has to be mitigated so the efficiency of
the system should be high and people can be certain about their investment in time.
The project can be further continued to gain the effectiveness of the prediction with
addition implementations of the content that can involve real time scenario and the way of
executing and processing the real time scenario. Various constrains has to be added and
performance of the same can be acylated in the future time for the effective results. The
expected form of the display is graph whereas from the same the more appearance and setting
of the display can be integrated and a pie-chart and a custom graph can further me
implemented on the same

Department of MCA Page 29


Apple.inc Stock Price Prediction

BIBBLIOGRAPHY

[1] K. Senthamarai Kannan, P. Sailapathi Sekar, M.Mohamed Sathik and P. Arumugam,


“Financial stock market forecastusing data mining Techniques", 2010, Proceedings of the
international multiconference of engineers and computerscientists.
[2] Tiffany Hui-Kuang yu and Kun-Huang Huarng, “A Neural network-based fuzzy
timeseries model to improveforecasting”, Elsevier, 2010, pp: 3366-3372.
[3] Python Data Science Hand Book by-Jake Vanderplas
[4] Analyticsvidhya. https://www.analyticsvidhya.com/blog/2018/10/predicting-stock-price-
machine-learningnd-deep-learning-techniques-python/
[5] Github. https://github.com/lucasrea/StockForecast/blob/master/StockAnalysis.ipynb
[6] Kaggle.com

Department of MCA Page 30

You might also like