Skip to content

birukd1/ml-price-predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine Learning Price Predictor

A comprehensive machine learning project that predicts house prices using multiple regression algorithms. This project demonstrates data preprocessing, feature engineering, model training, and evaluation techniques.

Project Overview

This price prediction system analyzes historical housing data to forecast property values. The project implements and compares multiple regression models including Linear Regression, Random Forest, and Gradient Boosting to achieve optimal prediction accuracy.

Technologies Used

  • Python 3.8+
  • Scikit-Learn
  • Pandas
  • NumPy
  • Matplotlib
  • Seaborn
  • Jupyter Notebook

Project Structure

price-predictor-ml/
│
├── data/
│   └── housing_data.csv
├── notebooks/
│   └── price_prediction_analysis.ipynb
├── src/
│   ├── data_preprocessing.py
│   ├── feature_engineering.py
│   ├── model_training.py
│   └── model_evaluation.py
├── models/
│   └── best_price_model.pkl
├── requirements.txt
├── README.md
└── .gitignore

Features

  • Data Preprocessing: Handles missing values, outliers, and data cleaning
  • Feature Engineering: Creates new features and scales existing ones
  • Multiple Models: Implements Linear Regression, Random Forest, and Gradient Boosting
  • Model Comparison: Evaluates and compares model performance
  • Hyperparameter Tuning: Optimizes model parameters using GridSearchCV
  • Visualization: Provides comprehensive data analysis and results visualization

Dataset

The project uses a synthetic housing dataset with the following features:

  • Size (square feet)
  • Bedrooms
  • Bathrooms
  • Location Score (1-10)
  • Age (years)
  • Garage (0/1)
  • Price (target variable)

Model Performance

Model MAE RMSE R² Score
Linear Regression 15,234 21,456 0.82
Random Forest 12,890 18,234 0.87
Gradient Boosting 11,567 17,123 0.89

Installation

  1. Clone the repository:
git clone https://github.com/username/price-predictor-ml.git
cd price-predictor-ml
  1. Install dependencies:
pip install -r requirements.txt

Usage

Quick Start

python src/model_training.py

Jupyter Notebook

jupyter notebook notebooks/price_prediction_analysis.ipynb

Making Predictions

from src.model_training import load_model, predict_price

model = load_model('models/best_price_model.pkl')
price = predict_price(model, size=2000, bedrooms=3, bathrooms=2, 
                     location_score=8.5, age=5, garage=1)
print(f"Predicted Price: ${price:,.2f}")

Results

The Gradient Boosting model achieved the best performance with:

  • Mean Absolute Error: $11,567
  • R² Score: 0.89
  • Root Mean Square Error: $17,123

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes
  4. Submit a pull request

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors