From efc1ce9f7f7ea380d273e41087ce5fe483a0b190 Mon Sep 17 00:00:00 2001 From: Vinay Esnapuram Date: Fri, 11 Jul 2025 23:26:32 +0530 Subject: [PATCH] NDV_Code_By_VinayEsnapuram_Real_Estate a house price prediction by knowing the area(sq. ft),number of bedrooms,age of the house --- .../real_estate.py | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 NDV_Code_By_VinayEsnapuram_Real_Estate/real_estate.py diff --git a/NDV_Code_By_VinayEsnapuram_Real_Estate/real_estate.py b/NDV_Code_By_VinayEsnapuram_Real_Estate/real_estate.py new file mode 100644 index 000000000..4a0093e35 --- /dev/null +++ b/NDV_Code_By_VinayEsnapuram_Real_Estate/real_estate.py @@ -0,0 +1,87 @@ + + + + Real Estate Price Predictor + + + + +

🏠 Real Estate Price Estimator

+
+
+
+
+
+ +
+
+ + {% if predicted_price %} +
Estimated Price: {{ predicted_price }}
+ {% endif %} + + + + + +app.js + +from flask import Flask, render_template, request +import joblib +import numpy as np +import pandas as pd + +app = Flask(__name__) + +# Load trained model and scaler +model = joblib.load('model.pkl') +scaler = joblib.load('scaler.pkl') + +@app.route('/') +def home(): + return render_template('index.html') + +@app.route('/predict', methods=['POST']) +def predict(): + area = float(request.form['area']) + bhk = int(request.form['bhk']) + age = int(request.form['age']) + + input_df = pd.DataFrame([[area, bhk, age]], columns=['area', 'bhk', 'age']) + input_scaled = scaler.transform(input_df) + prediction = model.predict(input_scaled)[0] + price_lakhs = prediction / 100000 + + return render_template('index.html', predicted_price=f"₹{price_lakhs:,.2f} Lakhs") + +if __name__ == '__main__': + app.run(debug=True)