An end-to-end Machine Learning system that predicts fair residential property prices and detects suspicious property listings using Linear Regression and Logistic Regression implemented completely from scratch with NumPy.
This project goes beyond traditional house price prediction by combining property valuation, fraud probability estimation, risk assessment, and an Explainable Fraud Engine into a single intelligent property analysis system.
Buying a property is one of the biggest financial decisions an individual makes. However, buyers often rely solely on the seller's quoted price without knowing whether it truly reflects the property's market value.
This project addresses that challenge by developing an AI-powered decision support system that:
- Predicts the fair market value of a property.
- Identifies suspicious property pricing.
- Estimates fraud probability.
- Calculates a risk score and assigns a risk level.
- Explains why a property is considered suspicious.
- Suggests a fair market price range.
- Predict accurate house prices using Linear Regression implemented from scratch.
- Detect suspicious property pricing using Logistic Regression implemented from scratch.
- Build a custom fraud detection dataset from an existing house price dataset.
- Generate explainable fraud analysis for better decision-making.
- Assist buyers in evaluating whether a property's quoted price is reasonable.
This project can be used by:
- ๐ Home Buyers for fair price estimation before purchasing.
- ๐ข Real Estate Companies for automated property valuation.
- ๐ฆ Banks during home loan property valuation.
- ๐ Property Investors to compare investment opportunities.
- ๐ Real Estate Platforms for intelligent pricing insights.
- ๐ Market Analysts for studying pricing patterns.
Dataset: Bengaluru House Price Dataset
The original dataset contains over 13,000 residential property listings.
- Area Type
- Availability
- Location
- Size
- Total Square Feet
- Bathrooms
- Balconies
- Price
Note: The original dataset does not contain fraud labels or suspicious property information.
The preprocessing pipeline includes:
- Removing unnecessary columns
- Handling missing values
- Extracting BHK values
- Converting area ranges into numeric values
- Removing duplicate records
- Handling rare locations
- Detecting and removing outliers
- Standardizing numerical features
To improve prediction performance, additional meaningful features were engineered.
- Price per Square Foot
- Square Feet per BHK
- Location Average Price
- Location Premium Index
- Quoted Price
- Inflation Ratio
- Difference Percentage
- Area Value Index
- Price Rank
- Risk Score
These engineered features were used to create a custom fraud detection dataset and improve model performance.
Raw Dataset
โ
โผ
Data Cleaning
โ
โผ
Feature Engineering
โ
โผ
Exploratory Data Analysis
โ
โผ
Linear Regression (From Scratch)
โ
โผ
Predicted Market Price
โ
โผ
Custom Fraud Dataset Generation
โ
โผ
Fraud Feature Engineering
โ
โผ
Logistic Regression (From Scratch)
โ
โผ
Fraud Probability Prediction
โ
โผ
Risk Score Generation
โ
โผ
Explainable Fraud Engine
โ
โผ
Final Property Analysis Report
Implemented completely from scratch using NumPy.
- Weight Initialization
- Bias Initialization
- Feature Standardization
- Mean Squared Error (MSE)
- Gradient Descent
- Weight Updates
- Prediction Function
Predict the fair market value of a property based on:
- Location
- Total Square Feet
- BHK
- Bathrooms
Since the original dataset did not contain fraud labels, a custom fraud detection pipeline was designed.
- Generate seller quoted prices
- Compare quoted price with predicted market price
- Generate fraud labels using rule-based logic
- Engineer fraud-related features
- Train Logistic Regression model
This transformed a standard regression dataset into a supervised fraud detection dataset.
Implemented completely from scratch using NumPy.
- Sigmoid Function
- Binary Cross Entropy Loss
- Gradient Descent
- Weight Updates
- Probability Prediction
- Binary Classification
Estimate the probability that a property's quoted price is suspicious.
| Metric | Value |
|---|---|
| Algorithm | Linear Regression |
| Implementation | NumPy (From Scratch) |
| Optimizer | Gradient Descent |
| Loss Function | Mean Squared Error |
| Epochs | 5000 |
| Learning Rate | 0.001 |
| Metric | Value |
|---|---|
| Algorithm | Logistic Regression |
| Implementation | NumPy (From Scratch) |
| Classification Accuracy | 97.74% |
| Precision | 98.12% |
| Recall | 98.45% |
| F1-Score | 98.28% |
Instead of simply classifying a property as suspicious, the system provides human-readable explanations.
Example outputs:
- Property appears moderately overpriced.
- Large positive deviation from predicted market price.
- Property price is close to estimated market value.
- Property is significantly below estimated market value (possible bargain).
The project also generates:
- Fraud Probability
- Risk Score
- Risk Level
Risk Levels:
- Low
- Moderate
- High
- Critical
The final system generates:
- Predicted Market Price
- Quoted Price
- Price Difference
- Fraud Probability
- Risk Score
- Risk Level
- Explainable Reasons
- Suggested Fair Price Range
| Category | Technologies |
|---|---|
| Programming | Python |
| Numerical Computing | NumPy |
| Data Processing | Pandas |
| Visualization | Matplotlib |
| Notebook | Google Colab |
| Machine Learning | Linear Regression, Logistic Regression |
Through this project I gained practical experience in:
- Machine Learning Fundamentals
- Linear Regression Mathematics
- Logistic Regression Mathematics
- Gradient Descent Optimization
- Feature Engineering
- Data Cleaning
- Exploratory Data Analysis (EDA)
- Custom Fraud Dataset Generation
- Explainable AI
- Model Evaluation
- Streamlit Web Application
- Interactive Dashboard
- Real-Time Property API Integration
- Multi-city Property Analysis
- Advanced Explainable AI
- Deep Learning Models
- Cloud Deployment
Most house price prediction projects stop after predicting the property's price.
This project extends beyond traditional prediction by:
- Implementing both Linear Regression and Logistic Regression completely from scratch.
- Designing a custom fraud detection pipeline.
- Engineering fraud-related features.
- Providing fraud probability estimation.
- Generating explainable fraud analysis.
- Producing a complete property analysis report.
It demonstrates not only machine learning implementation but also problem-solving, feature engineering, explainability, and end-to-end system design.
Contributions, suggestions, and improvements are welcome.
Feel free to fork this repository, open issues, or submit pull requests.
If you found this project useful, consider giving it a โญ on GitHub.