Predicting House Prices in Pune using Random Forest
- Create and activate a virtual environment (optional but recommended)
- Windows PowerShell
python -m venv venv./venv/Scripts/Activate.ps1
- Install dependencies
pip install -r requirements.txt- Train or reuse the model
- The repo already includes
house_price_model.pkl. If you want to retrain:
python train_model.py- Run the web app
python app_with_reverse_geocoding.pyThen open your browser to http://127.0.0.1:5000/.
- Great UI with a price prediction form and interactive map
- Predicts price (in Lakhs) from inputs:
Area,Area (sq.ft.),BHK,Bathrooms,Furnishing Status,Age of Property (years), and distances to School/Hospital/Metro - Optional AI-powered location summaries on map clicks
The app can summarize clicked map locations using Gemini. This is optional.
- Get an API key
- Create a key and set it as an environment variable
GEMINI_API_KEY.
- Create a key and set it as an environment variable
- Run the app with the environment variable set
$env:GEMINI_API_KEY="YOUR_KEY_HERE"; python app_with_reverse_geocoding.pyIf no key is provided, the app will still run and show a simple fallback summary.
- The frontend calls relative endpoints (
/predictand/summarize-location), so it works as long as the HTML is served by Flask (default behavior inapp_with_reverse_geocoding.py). - CORS is enabled; you can also host the HTML separately if needed.