Skip to content

This project focuses on predicting the stock prices of "The State Bank Of India" using machine learning Regression algorithms.

License

Notifications You must be signed in to change notification settings

rohitinu6/Stock-Price-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Typing SVG

Stock Prediction Model

๐Ÿ“ˆ GitHub Repository Stats

๐ŸŒŸ Stars ๐Ÿด Forks ๐Ÿ› Issues ๐Ÿ”” Open PRs ๐Ÿ”• Closed PRs ๐Ÿ› ๏ธ Languages โœ… Contributors
GitHub stars forks issues pull requests Closed PRs Languages Contributors

This project is now OFFICIALLY accepted for

GSSoC 2024 Extd Hacktober fest 2024

โœจ Project Structure

Check the project structure here Project Structure

๐Ÿ“š Table of Contents

  1. ๐ŸŒŸ Overview
  2. ๐Ÿ› ๏ธ Features
  3. ๐Ÿ” Algorithms Used
  4. ๐Ÿ“Š Dataset
  5. ๐Ÿ“ Project Structure
  6. ๐Ÿš€ How to Run
  7. ๐Ÿ“ˆ Results
  8. ๐Ÿ“Š Performance Metrics
  9. ๐Ÿ”ฎ Future Work
  10. ๐Ÿ† Conclusion
  11. โœ๏ธ Author
  12. ๐Ÿค Contributing
  13. ๐ŸŒ Our Valuable Contributors
  14. ๐Ÿ“ License

๐ŸŒž Overview

This project aims to predict the stock prices of The State Bank of India (SBI) using various machine learning regression algorithms. By leveraging historical stock data sourced from Yahoo Finance, this project provides insights into the performance of different regression models in stock price prediction for SBI.

The primary objective is to compare model accuracy and performance metrics, such as RMSE, MAE, and MAPE, across multiple algorithms, ultimately identifying the most suitable regression approach for stock price forecasting.

๐Ÿ› ๏ธ Features

  • Utilizes various regression algorithms for stock price prediction.
  • Dataset collected from Yahoo Finance for The State Bank Of India.

๐Ÿ” Algorithms Used

We implemented the following regression algorithms for stock price prediction:

๐Ÿค– Algorithm ๐Ÿ“œ Description
Linear Regression A basic regression algorithm.
Support Vector Regression (SVR) Effective for non-linear relationships.
Random Forest Ensemble learning method using decision trees.
Gradient Boosting Models (GBM) Sequentially builds models to improve predictions.
Extreme Gradient Boosting (XGBoost) Advanced boosting technique with regularization.
AdaBoostRegressor Combines multiple weak learners.
Decision Tree Simple yet effective model based on tree structure.
KNeighborsRegressor (KNN) Predicts based on nearest neighbors' average.
Artificial Neural Networks (ANN) Mimics human brain for complex data patterns.
Long Short Term Memory (LSTM) Suitable for time-series prediction.

๐Ÿ“Š Dataset

The dataset used in this project is sourced from Yahoo Finance and includes historical stock data for The State Bank Of India. It comprises relevant features such as:

  • ๐Ÿ“ˆ Open prices
  • ๐Ÿ“‰ High prices
  • ๐Ÿ“‰ Low prices
  • ๐Ÿ’ต Close prices
  • ๐Ÿ“ฆ Volume

๐Ÿ“ Project Structure

๐Ÿ“‚ data/ # Contains the dataset files. ๐Ÿ““ notebooks/ # Jupyter notebooks with the code for data exploration, preprocessing, and model training. ๐Ÿ src/ # Python source code for the project. ๐Ÿ“‹ requirements.txt # List of dependencies needed to run the project.

๐Ÿš€ How to Run main.py

Steps: 1.If Flask is not installed, install it:

pip install flask

2.Install dependencies using:

pip install -r requirements.txt

3.Run the Flask app:

python main.py

๐Ÿ“ˆ Results

The sequence of all the algorithms used is as follows:

  1. Linear Regression
  2. SVR
  3. Random Forest
  4. Gradient Boosting Models (GBM)
  5. Extreme Gradient Boosting (XGBoost)
  6. AdaBoostRegressor
  7. Decision Tree
  8. KNeighborsRegressor (KNN)
  9. Artificial Neural Networks (ANN)
  10. Long Short Term Memory (LSTM)

๐Ÿ“Š Performance Metrics

The Root Mean Square Error (RMSE) of all the following 10 Regression Algorithms is provided below: Performance-Metrices

The Mean Absolute Error (MAE) of all the following 10 Regression Algorithms is provided below:

Performance-Metrices

The Mean Absolute Percentage Error (MAPE) of all the following 10 Regression Algorithms is provided below:

Performance-Metrices

๐Ÿ”ฎ Future Work

  • Combine this data with stock sentiment data to enhance prediction accuracy.
  • Utilize clustering algorithms to develop a buy/sell recommendation system.

๐Ÿ† Conclusion

Among the models assessed, AdaBoostRegressor and LSTM emerged as the top performers, showcasing low RMSE, MAE, and MAPE values. These metrics suggest that these algorithms effectively capture the underlying trends and patterns in the stock price data, making them reliable for prediction tasks.

While some models demonstrated solid predictive capabilities, others, such as Support Vector Regression (SVR) and KNeighborsRegressor, recorded higher RMSE and MAE values. This indicates that these algorithms may yield acceptable predictions on average but are susceptible to significant errors in certain scenarios, emphasizing the need for careful model selection for stock price predictions.

โœ๏ธ Author

Rohit Dubey ๐Ÿ‘จโ€๐Ÿ’ป

๐Ÿค Contributing

We welcome contributions to this project! Please see our Contributing.md file for guidelines on how to get involved.

๐ŸŒ Our Valuable Contributors

๐ŸŽ‰ Thank You to All Our Amazing Contributors! ๐ŸŽ‰

We are incredibly grateful for your dedication and hard work. Your contributions have been invaluable in making this project a success. Thank you for being a part of our journey!

Let's continue to build great things together! ๐Ÿš€

๐Ÿ“ License

This project is licensed under the MIT License.

๐Ÿ“ฑ Connect with Us