A machine learning project that predicts whether a stock's price will go UP or DOWN the next day based on historical data. The project includes data processing, feature engineering, model training using Logistic Regression, and a Streamlit web application for interactive predictions.
app.py: Streamlit application for interactive prediction.predict.py: Script for making predictions in the terminal.test.py: Script for data loading, feature engineering, model training, evaluation, saving the model, and plotting.stock_data.csv: Historical stock data used for training.requirements.txt: Python dependencies.
-
Clone the repository:
git clone <repository_url> cd "Stock Price Predection"
-
Install dependencies:
pip install -r requirements.txt
-
Train the Model: First, you need to train the model so that
app.pyandpredict.pycan load the saved models. Run the test script to generate the models:python test.py
Note: This will generate
scaler.pklandstock_trend_model.pkl. Move them to amodels/directory forapp.pyto use them. -
Run the Streamlit App:
streamlit run app.py
The project performs feature engineering (Daily Return, Moving Averages, Volatility, etc.), scales features, and uses Logistic Regression to perform binary classification on the target (1 for UP, 0 for DOWN).
Pavan