Spaces:
Sleeping
Sleeping
Nrup Parikh
commited on
Commit
Β·
fdff020
1
Parent(s):
886d114
Readme update
Browse files
README.md
CHANGED
|
@@ -10,3 +10,44 @@ short_description: Stock Prediction using Flask framework
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 13 |
+
|
| 14 |
+
# π§ Stock Price Predictor β Flask + Random Forest
|
| 15 |
+
|
| 16 |
+
A machine learning web app built using Flask and deployed on Hugging Face Spaces with Docker.
|
| 17 |
+
It predicts future stock prices using historical Yahoo Finance data and Random Forest regression.
|
| 18 |
+
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
## π Tech Stack
|
| 22 |
+
- **Flask** β Web framework to build the backend logic and user interface.
|
| 23 |
+
- **Gunicorn** β WSGI production server for running Flask apps.
|
| 24 |
+
- **YFinance** β Fetches live and historical stock data.
|
| 25 |
+
- **Scikit-learn** β Implements the Random Forest prediction model.
|
| 26 |
+
- **Pandas & NumPy** β For data manipulation and mathematical operations.
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## βοΈ Features
|
| 31 |
+
β
Fetch 5 years of stock data from Yahoo Finance
|
| 32 |
+
β
Compute indicators (RSI, MACD, Moving Averages)
|
| 33 |
+
β
Predict next 30-day prices using Random Forest
|
| 34 |
+
β
Detect trend (Bullish / Bearish / Sideways)
|
| 35 |
+
β
Suggest entry and stop-loss points
|
| 36 |
+
β
Display detailed report and 30-day recent table
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## π³ Deployment on Hugging Face
|
| 41 |
+
This Space uses **Docker runtime**.
|
| 42 |
+
|
| 43 |
+
### Files used:
|
| 44 |
+
- `Dockerfile` β Defines the container environment
|
| 45 |
+
- `requirements.txt` β Lists Python dependencies
|
| 46 |
+
- `app.py` β Contains Flask application logic
|
| 47 |
+
|
| 48 |
+
To deploy:
|
| 49 |
+
1. Create a new **Hugging Face Space**.
|
| 50 |
+
2. Choose **Docker** as the SDK.
|
| 51 |
+
3. Upload `app.py`, `requirements.txt`, and `Dockerfile`.
|
| 52 |
+
4. Click **Deploy Space** β your Flask app will run automatically on port **7860**.
|
| 53 |
+
|