A stock market analysis and prediction web application built using Streamlit - Python. The project utilizes machine learning models (Linear Regression, Random Forest, LSTM) to predict stock prices and visualize stock trends.
- Fetches real-time stock data using
yfinance. - Supports multiple prediction models: Linear Regression, Random Forest, and LSTM.
- Displays stock charts using
plotly. - Identifies top gainers and losers in Sensex and Nifty.
- Deployable on Streamlit and Flask.
- Python 3.10+
- Virtual environment (
venvorcondarecommended) - Required dependencies (listed in
requirements.txt)
- Clone the repository:
git clone https://github.com/Yuvan-1166/Stock-Analysis.git cd stock-predictor - Create a virtual environment and activate it:
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the Streamlit application:
streamlit run Home.py
- Enter the stock ticker, start date, and end date.
- Choose a prediction model to forecast future stock prices.
- View stock trends, gainers, and losers in interactive charts.
- Linear Regression: Simple and interpretable model for stock trend analysis.
- Random Forest: Provides better generalization and robustness.
- LSTM (Long Short-Term Memory): Captures sequential patterns in stock data.
- Trained models are saved as
.pklfiles usingjoblib. - Example:
import joblib scaler = joblib.load('scaler.pkl') model = joblib.load('stock_predictor_model.pkl')
- Fork the repo and create a new branch.
- Implement changes and submit a pull request.
- Ensure proper documentation and testing.
Developed by Yuvan Shankar S.
For queries or collaboration, email: yuvanshankars.1166@google.com