Should I invest in stock
market?
The history of forcasting
Should I
BUY TATA
Ltd.
Shares…
Well..!!
Tata’s
Future is
Good…
This Question Remains in Every Investors Mind.
How To Be Rich In Stock Market?
Forecasting Financial future :
Stock price prediction
A Data-Mining Approach…
Capstone-1 project
group no. 117
INTRODUCTION
01
A Share Market is
a Place Where
Share are put up
for
public Trading.
Stock Markets are
highly volatile and
generate huge
amounts of Data
daily.
Because of its high
profit margin,
investing in the
stock market is one
of the most popular
alternatives.
03
INTRODUCTION
01
A Share Market is
a Place Where
Share are put up
for
public Trading.
Stock Markets are
highly volatile and
generate huge
amounts of Data
daily.
02
Because of its high
profit margin,
investing in the
stock market is one
of the most popular
alternatives.
03
02
INTRODUCTION
01
A Share Market is
a Place Where
Share are put up
for
public Trading.
Stock Markets are
highly volatile and
generate huge
amounts of Data
daily.
02
Because of its high
profit margin,
investing in the
stock market is one
of the most popular
alternatives.
03
As the amount of
trading and
investment rose,
people searched
for methods and
tools that would
maximize their
gains while
reducing their
risk.
5 REASONS WHY WE NEED IT..
5
REASONS
01
Market Analysis
Stock Price Forecasting software enables
through analysis of market patterns and
trends. By analyzing the data and the
current situation of the industry, it helps
identify emerging trends and investment
opportunities
04
Decision Making
Software that forecasts stock prices can
help traders and investors make sound
choices about purchasing by providing
data on possible future market shifts
aids in the development effective trading
strategies.
03
Risk Management
Predictive models help in assessing
market risks and making informed
decisions to mitigate potential losses.
02
Automation
Investors and analysts save energy and
labour by cutting human effort through
the automation of shares prediction
operations.
05
Technological Advancement
Leveraging advancements in machine
learning to handle large datasets and
uncover hidden patterns, improving
predictive capabilities..
2 3
1
DATA COLLECTION AND
PREPROCESSING
SPLIT THE
DATA
INTO TEST
SETS
CREATING AND
TRAINING THE
MODEL
This Requires collecting
information from sources of
income and preparing it such
that it is accurate and useful.
Removing errors, and adding
missing details are aspects of
data cleaning
Using the training data, a
machine learning model is
selected and trained in this
stage. The programme gains the
ability to spot data patterns that
may be utilized to forecast future
stock values
Next, a pair of data are created
from the data: a test set and a
training set. The machine
learning model is trained on the
training set, and its performance
is determined on the test set.
5 6
4
FEATURE
ENGENEERING
MAKING
PREDECTIONS
BACKTESTING OUR
MODEL
The model may be used to
forecast future stock prices once
it has been trained. The model
will forecast the related stock
price by using fresh data as
input.
It involves creating new features
or modifying existing ones to
improve the performance of the
model. The goal is to make the
data more suitable for the
algorithm to learn from.
It involves testing the model on
historical data to see how well it
would have predicted stock
prices
IMPORTING
LIBRARIES
•Pandas: Provides data manipulation and
analysis tools, including DataFrames for
handling tabular data and functions for
data cleaning.
•Matplotlib: A plotting library for creating
static, animated, and interactive
visualizations in Python, such as line plots
and histograms.
•Datetime: A module for manipulating
dates and times, supporting date
arithmetic, time zones, and formatting.
•NumPy: Offers numerical computing
tools, including support for large multi-
dimensional arrays and matrices, along
with mathematical functions.
•Scikit-learn: A massive machine learning
library providing tools for data mining,
including classification, regression,
clustering, and dimensionality reduction
DATA COLLECTION AND
PREPROCESSING
DATA
COLLECTION
The first step in building a
prediction model is gathering
the stock price data.
In our project, we have used
the data provider ‘Alpha
Vantage’ to extract our dataset
in json format because it is:-
1. Human-Readable and Easy
to Understand
2. Lightweight and Compact
3. Language Agnostic
4. Integrated with web APIs
5. Supports Nested and
Complex Data Structures
6. Compatibility with NoSQL
Databases
7. Flexibility in Data
Representation
8. Ease of Parsing and
Serialization
DATA
PREPROCESSING
1. Data preprocessing is a crucial step
in building a stock price prediction
model. It involves preparing raw
data for analysis by cleaning,
transforming, and structuring it.
Proper preprocessing helps improve
the model's accuracy and
performance
2. Preprocessing involves cleaning the
data, handling missing values, and
normalizing it. It also includes
creating new features that can
improve model performance, such
as moving averages.
Steps include:
3. Handling missing values
4. Impute missing data
5. Dealing with outliers
6. Normalizing and scaling
7. Removing duplicates
8. Encoding categorical data
9. Handling date and time data
10. Ensuring data consistency
SPLIT THE DATA
INTO TEST SETS
SPLIT THE DATA
INTO TEST SETS
Splitting data into test sets is a
crucial step in building a reliable
stock price prediction model. The
following steps are performed-
1.Loading data- read your stock
price data into a pandas
dataframe.
2.Sort by date- ensuring the data
is sorted by date, , this ensures
that the temporal order is
maintained which is crucial for
time series data.
3. Splitting the data- divide the
data into training and test sets
where you might typically use 70-
80% of the data for training and
remaining 20-30% for testing, this
maintains the chronological order
of the data which is important for
time series prediction tasks.
CREATING AND
TRAINING THE
MODEL
CREATING AND
TRAINING THE
MODEL
Creating and training a stock price
prediction model involves several steps,
including data preprocessing, model
selection, defining the architecture,
compiling the model, training it on
historical data, and evaluating its
performance. We trained the model
using Python with TensorFlow.
To train the LSTM model on the training
data, we specified the batch size, number
of epochs, and optionally validation data.
Training data in a stock price prediction
model is crucial for several reasons, like-
1. Pattern Recognition
2. Model Learning
3.Generalization
4.Optimization
5.Validation and Testing
6.Improving Forecast Accuracy
FEATURE
ENGINEERING
FEATURE
ENGINEERING
Feature engineering is a
crucial step in building a
robust stock price
prediction model. It
involves creating new
features from raw data
that can help the model
understand patterns
and make more accurate
predictions. Here are
some common
techniques and features
used in stock price
prediction:
1.Technical indicators
2.. Statistical features
3.Time based features
4.Fundamental features
5.Sentiment analysis
6.External factors
7.Custom features
BACKTESTING
OUR MODEL
Backtesting
our model
Backtesting is an essential
step in evaluating the
performance of a stock
price prediction model. It
involves testing the model
on historical data to see
how well it would have
predicted stock prices.
Here, we will build a simple
stock price prediction
model using TensorFlow
and backtest it.
For backtesting our model,
we perform the following –
1. Predict stock prices on
test set
2. Inverse transform the
predictions to get them
back to original scale
3. Evaluate the model
using Mean Squared
Error
4. Plot the actual vs
MAKING
PREDICTIONS
Making
predictions
We predict the stock
prices on the test set
and inverse transform
the predictions to get
them back to the original
scale.
We evaluate the model
using MSE and plot the
actual vs predicted stock
prices.
To predict the next days’s
stock prices, we take the
last ‘window size’ days
of scaled data, reshape it
for the LSTM model and
and make a prediction.
We then inverse
transform the prediction
Our Team
Kailash Rahul Sanjana Sakshi Shreyanka
kailash
Kailash
Roll No:
2312RES317
Our Team
Kailash Rahul Sanjana Sakshi Shreyanka
rahul
Rahul
Roll No:
2312RES485
Our Team
Kailash Rahul Sanjana Sakshi Shreyanka
Sanjana
Sanjana
Roll No:
2312RES575
Our Team
Kailash Rahul Sanjana Sakshi Shreyanka
Sakshi
Sakshi
Roll No:
2312RES563
Our Team
Kailash Rahul Sanjana Sakshi Shreyanka
shreyanka
Shreyanka
Roll No:
2312RES627

python web development ppt with code and the output.pptx

  • 1.
    Should I investin stock market?
  • 2.
    The history offorcasting Should I BUY TATA Ltd. Shares… Well..!! Tata’s Future is Good… This Question Remains in Every Investors Mind.
  • 3.
    How To BeRich In Stock Market? Forecasting Financial future : Stock price prediction A Data-Mining Approach…
  • 4.
  • 5.
    INTRODUCTION 01 A Share Marketis a Place Where Share are put up for public Trading. Stock Markets are highly volatile and generate huge amounts of Data daily. Because of its high profit margin, investing in the stock market is one of the most popular alternatives. 03
  • 6.
    INTRODUCTION 01 A Share Marketis a Place Where Share are put up for public Trading. Stock Markets are highly volatile and generate huge amounts of Data daily. 02 Because of its high profit margin, investing in the stock market is one of the most popular alternatives. 03 02
  • 7.
    INTRODUCTION 01 A Share Marketis a Place Where Share are put up for public Trading. Stock Markets are highly volatile and generate huge amounts of Data daily. 02 Because of its high profit margin, investing in the stock market is one of the most popular alternatives. 03 As the amount of trading and investment rose, people searched for methods and tools that would maximize their gains while reducing their risk.
  • 8.
    5 REASONS WHYWE NEED IT.. 5 REASONS 01 Market Analysis Stock Price Forecasting software enables through analysis of market patterns and trends. By analyzing the data and the current situation of the industry, it helps identify emerging trends and investment opportunities 04 Decision Making Software that forecasts stock prices can help traders and investors make sound choices about purchasing by providing data on possible future market shifts aids in the development effective trading strategies. 03 Risk Management Predictive models help in assessing market risks and making informed decisions to mitigate potential losses. 02 Automation Investors and analysts save energy and labour by cutting human effort through the automation of shares prediction operations. 05 Technological Advancement Leveraging advancements in machine learning to handle large datasets and uncover hidden patterns, improving predictive capabilities..
  • 9.
    2 3 1 DATA COLLECTIONAND PREPROCESSING SPLIT THE DATA INTO TEST SETS CREATING AND TRAINING THE MODEL This Requires collecting information from sources of income and preparing it such that it is accurate and useful. Removing errors, and adding missing details are aspects of data cleaning Using the training data, a machine learning model is selected and trained in this stage. The programme gains the ability to spot data patterns that may be utilized to forecast future stock values Next, a pair of data are created from the data: a test set and a training set. The machine learning model is trained on the training set, and its performance is determined on the test set.
  • 10.
    5 6 4 FEATURE ENGENEERING MAKING PREDECTIONS BACKTESTING OUR MODEL Themodel may be used to forecast future stock prices once it has been trained. The model will forecast the related stock price by using fresh data as input. It involves creating new features or modifying existing ones to improve the performance of the model. The goal is to make the data more suitable for the algorithm to learn from. It involves testing the model on historical data to see how well it would have predicted stock prices
  • 11.
    IMPORTING LIBRARIES •Pandas: Provides datamanipulation and analysis tools, including DataFrames for handling tabular data and functions for data cleaning. •Matplotlib: A plotting library for creating static, animated, and interactive visualizations in Python, such as line plots and histograms. •Datetime: A module for manipulating dates and times, supporting date arithmetic, time zones, and formatting. •NumPy: Offers numerical computing tools, including support for large multi- dimensional arrays and matrices, along with mathematical functions. •Scikit-learn: A massive machine learning library providing tools for data mining, including classification, regression, clustering, and dimensionality reduction
  • 12.
  • 13.
    DATA COLLECTION The first stepin building a prediction model is gathering the stock price data. In our project, we have used the data provider ‘Alpha Vantage’ to extract our dataset in json format because it is:- 1. Human-Readable and Easy to Understand 2. Lightweight and Compact 3. Language Agnostic 4. Integrated with web APIs 5. Supports Nested and Complex Data Structures 6. Compatibility with NoSQL Databases 7. Flexibility in Data Representation 8. Ease of Parsing and Serialization
  • 14.
    DATA PREPROCESSING 1. Data preprocessingis a crucial step in building a stock price prediction model. It involves preparing raw data for analysis by cleaning, transforming, and structuring it. Proper preprocessing helps improve the model's accuracy and performance 2. Preprocessing involves cleaning the data, handling missing values, and normalizing it. It also includes creating new features that can improve model performance, such as moving averages. Steps include: 3. Handling missing values 4. Impute missing data 5. Dealing with outliers 6. Normalizing and scaling 7. Removing duplicates 8. Encoding categorical data 9. Handling date and time data 10. Ensuring data consistency
  • 15.
  • 16.
    SPLIT THE DATA INTOTEST SETS Splitting data into test sets is a crucial step in building a reliable stock price prediction model. The following steps are performed- 1.Loading data- read your stock price data into a pandas dataframe. 2.Sort by date- ensuring the data is sorted by date, , this ensures that the temporal order is maintained which is crucial for time series data. 3. Splitting the data- divide the data into training and test sets where you might typically use 70- 80% of the data for training and remaining 20-30% for testing, this maintains the chronological order of the data which is important for time series prediction tasks.
  • 17.
  • 18.
    CREATING AND TRAINING THE MODEL Creatingand training a stock price prediction model involves several steps, including data preprocessing, model selection, defining the architecture, compiling the model, training it on historical data, and evaluating its performance. We trained the model using Python with TensorFlow. To train the LSTM model on the training data, we specified the batch size, number of epochs, and optionally validation data. Training data in a stock price prediction model is crucial for several reasons, like- 1. Pattern Recognition 2. Model Learning 3.Generalization 4.Optimization 5.Validation and Testing 6.Improving Forecast Accuracy
  • 19.
  • 20.
    FEATURE ENGINEERING Feature engineering isa crucial step in building a robust stock price prediction model. It involves creating new features from raw data that can help the model understand patterns and make more accurate predictions. Here are some common techniques and features used in stock price prediction: 1.Technical indicators 2.. Statistical features 3.Time based features 4.Fundamental features 5.Sentiment analysis 6.External factors 7.Custom features
  • 21.
  • 22.
    Backtesting our model Backtesting isan essential step in evaluating the performance of a stock price prediction model. It involves testing the model on historical data to see how well it would have predicted stock prices. Here, we will build a simple stock price prediction model using TensorFlow and backtest it. For backtesting our model, we perform the following – 1. Predict stock prices on test set 2. Inverse transform the predictions to get them back to original scale 3. Evaluate the model using Mean Squared Error 4. Plot the actual vs
  • 23.
  • 24.
    Making predictions We predict thestock prices on the test set and inverse transform the predictions to get them back to the original scale. We evaluate the model using MSE and plot the actual vs predicted stock prices. To predict the next days’s stock prices, we take the last ‘window size’ days of scaled data, reshape it for the LSTM model and and make a prediction. We then inverse transform the prediction
  • 25.
    Our Team Kailash RahulSanjana Sakshi Shreyanka kailash Kailash Roll No: 2312RES317
  • 26.
    Our Team Kailash RahulSanjana Sakshi Shreyanka rahul Rahul Roll No: 2312RES485
  • 27.
    Our Team Kailash RahulSanjana Sakshi Shreyanka Sanjana Sanjana Roll No: 2312RES575
  • 28.
    Our Team Kailash RahulSanjana Sakshi Shreyanka Sakshi Sakshi Roll No: 2312RES563
  • 29.
    Our Team Kailash RahulSanjana Sakshi Shreyanka shreyanka Shreyanka Roll No: 2312RES627