Skip to content

A stock prediciton and analysis website using yfinance , pandas and streamlit

License

Notifications You must be signed in to change notification settings

rounak-codes/StockPreds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📈 Stock Market Prediction

Welcome to the Stock Market Prediction WebApp — a full-featured stock trend prediction platform using Machine Learning and Deep Learning models.

It supports:

  • Traditional models like Random Forest
  • Deep learning models like LSTM
  • Prophet for time-series forecasting
  • Side-by-side model comparisons for global and Indian markets!

🚀 Features

  • Predict stock trends globally and for Indian stocks (NSE).
  • Multiple models supported:
    • Random Forest (ML)
    • LSTM (Deep Learning)
    • Prophet (Time-Series Forecasting)
  • Future Forecasting for upcoming months
  • Visualization of trends and model components
  • Streamlit UI for easy interaction
  • Auto noise smoothing for more realistic forecasts
  • Works with both global stocks (via yfinance) and Indian stocks (via nsepy).

📈 Screenshots

Screenshot3 Screenshot1 Screenshot2


📦 Requirements

Install dependencies with:

pip install -r requirements.txt

requirements.txt:

pandas
numpy
matplotlib
seaborn
scikit-learn
yfinance
nsepy
xgboost
streamlit
tensorflow
prophet

🛠️ Project Structure

├── app/
    └──streamlit_app.py  # Streamlit dashboard app
    └──utils.py          # Functions for prophet
├── data/
│   └── global/          # CSV stock data for global stocks
│   └── india/           # CSV stock data for Indian stocks
├── models/
│   └── global/          # Trained models for global stocks (Random Forest, LSTM)
│   └── india/           # Trained models for Indian stocks
├── fetchdata.py         # To fetch stock data in CSV
├── rf_predict.py        # Random Forest prediction scripts
├── lstm_predict.py      # LSTM deep learning prediction scripts
├── prophet_predict.py   # Prophet forecasting scripts
├── preprocess.py        # Feature engineering utilities   
├── requirements.txt
├── train_model.py       # For training Random Forest
├── train_lstm.py        # For training LSTM

📊 Models and How They Work

Model Type Strengths
Random Forest Machine Learning Good on historical feature patterns
LSTM Deep Learning Learns sequential trends and patterns
Prophet Time-Series Model Captures seasonality and trend changes

🚀 Running the App

First, make sure you have your models trained and saved in /models.

Then, run:

streamlit run streamlit_app.py

It will open the dashboard automatically in your browser! 🌟


⚙️ Training New Models

  • Train Random Forest models separately (using your own scripts or notebooks).
  • Train LSTM models and save .h5 models along with corresponding scalers (joblib format).
  • Prophet automatically retrains based on the selected stock.

📜 License

This project is licensed under the MIT License - feel free to use, modify, and share!


About

A stock prediciton and analysis website using yfinance , pandas and streamlit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages