LP-III - Mini Project Report (ML)
LP-III - Mini Project Report (ML)
REPORT ON
Of
BY
This is to certify that, Ms. (Name of Student) Roll No. have successfully completed the
report entitled “Predict Future Stock Prices” under the supervision of Ms. R. T. Waghmode, in the
fulfillment of the requirement of Laboratory Practice-III in Final Year Computer Engineering, in the
academic year 2024-2025 prescribed by Savitribai Phule Pune University, Pune .
(Dr. S. D. Markande)
Principal
Place : Pune
Date :
Acknowledgement
I take this opportunity to acknowledge each and every one who contributed towards my work.
I express my sincere gratitude towards Ms. R. T. Waghmode, Assistant Professor at Sinhgad Institute of
Technology and Science, Narhe , Pune , for her valuable inputs , guidance and support throughout the
course.
Sinhgad Institute of Technology and Science, Narhe for giving me all the help and important suggestions
all over the Work. I thank all the teaching staff members, for their indispensable support and priceless
suggestions.
I also thank my friends and family for their help in collecting data , without their help Course
report have not been completed. At the end ,my special thanks to Dr. S. D. Markande, Principal
Sinhgad Institute of Technology and Science, Narhe for providing ambience in the college, which
motivate us to work.
Signature
Natesh Khadse
Raj Mankar
Prathamesh Nawale
Ashwin Pawar
Contents
1 Introduction 5
2 Problem Definition 6
3 Project Architecture 7
4 Hardware & Software Requirement 8
5 Project Description 9
6 Implementation 10
7 GUI 13
8 Conclusion 14
9 Reference 15
1. INTRODUCTION
The stock market serves as a barometer of a country's economic health, with price fluctuations
reflecting both investor sentiment and macroeconomic factors. In India, the stock market has
experienced considerable volatility from 2000 to 2020, influenced by events like the global financial
crisis, changes in government policies, and the COVID-19 pandemic.
Understanding the market’s ups and downs and predicting future stock prices is crucial for investors,
policymakers, and financial analysts.
In this project, we use Indian stock market data from 2000 to 2020 to analyze historical trends
and build models that predict future stock returns. With the aid of machine learning algorithms, this
project seeks to explore the driving forces behind market movements and to predict stock prices based
on historical data.
2. PROBLEM DEFINITION
The project aims to analyze Indian stock market data from 2000 to 2020 to understand the factors
influencing stock price movements and predict future stock prices using machine learning models like
Linear Regression, Random Forest, and LSTM. The goal is to provide valuable insights for investors
and analysts.
3. PROJECT ARCHITECTURE
4. SOFTWARE & HARDWARE REQUIREMENT
Software Requirements:
- Software and Libraries: Jupyter Notebook or Google, Pandas, NumPy, Matplotlib and
Seaborn, Scikit-learn, TensorFlow/Keras, Statsmodels.
Hardware Requirements:
The dataset used in this project consists of Indian stock market data spanning from 2000 to 2020.
It includes essential information such as the specific trading date, opening and closing prices, high
and low prices, trading volume, and adjusted closing prices. To ensure data quality and consistency,
the dataset underwent rigorous preprocessing, which involved handling missing values and removing
outliers. Additionally, new features were engineered to capture stock price trends, including moving
averages, volatility, and daily returns.
Exploratory data analysis (EDA) was conducted to gain valuable insights into the stock market
data. Key events like the 2008 global financial crisis, 2016 demonetization, and the 2020 COVID-19
pandemic were analyzed to understand their impact on stock prices.
Visualizations of stock price trends, moving averages, and daily returns helped identify patterns and
market behavior. Correlation analysis was performed to examine relationships between different
variables, such as opening price, closing price, and volume.
Several machine learning models were employed to predict future stock prices. These models
included Linear Regression, Random Forest, and Long Short-Term Memory (LSTM). Linear
Regression, a simple model, predicts stock prices based on linear relationships between input
variables and output values. Random Forest, an ensemble model, combines multiple decision trees to
capture complex non-linear relationships in the data. LSTM, a type of recurrent neural network, is
well-suited for stock market data as it can capture long-term dependencies and trends.
The dataset was divided into training and testing sets, with 80% of the data used for training and
20% for testing. Each model was trained on the historical data to predict future stock prices. The
models were evaluated using Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE)
metrics. RMSE measures the overall difference between predicted and actual stock prices, while
MAE provides the average magnitude of prediction errors. These metrics helped assess the accuracy
and performance of the models in predicting stock price movements.
6. IMPLEMENTATION
import pandas as pd
import numpy as np
data.fillna(method='ffill', inplace=True)
data['Close'].rolling(window=50).mean() data['200_MA'] =
data['Close'].rolling(window=200).mean() data['Daily_Return'] =
data['Close'].pct_change()
model_rf = RandomForestRegressor(n_estimators=100)
= model_rf.predict(X_test)
Dense
= Sequential()
model_lstm.add(Dense(1)) # Compile
loss='mean_squared_error')
epochs=5)
model_lstm.predict(X_test_lstm)
7. GUI
8. CONCLUSION
This project highlighted the potential of machine learning models, particularly LSTM, for
analyzing stock market data and predicting future stock price movements. While the predictions made
by these models are useful, they are not definitive due to the unpredictability of the market. As a
result, future research should focus on refining these models by incorporating more factors and
developing hybrid approaches to improve prediction accuracy. Nonetheless, the tools and models
discussed in this project provide a valuable foundation for investors looking to make informed
decisions based on historical data and trend analysis.
9. REFERENCE
1. H. Patel and S. Shah, "Forecasting Stock Market Movements Using Machine Learning
Techniques", 2016, ResearchGate.
2. R. Reddy and P. Kumar, "Stock Price Prediction Using Support Vector Machines and
Neural Networks", 2018, IEEE.
4. R. Shankar and P. Verma, "Stock Market Prediction Using Linear Regression Models", 2017,
IEEE.
5. K. Gupta and A. Mukherjee, "Random Forest for Stock Market Prediction", 2018, IEEE.
6. M. S. Hussain and K. S. Reddy, "Deep Learning for Stock Market Prediction Using
LSTM", 2020, IEEE.