Skip to content

A machine learning project to predict house prices based on features like income, house age, number of rooms, bedrooms, and population. Utilizes linear regression for accurate price estimation and includes comprehensive visualizations for data insights.

Notifications You must be signed in to change notification settings

Jotis86/House-Price-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

🏡 House Price Prediction Project

🎯 Objective

The objective of this project is to predict house prices based on various features such as average area income, house age, number of rooms, number of bedrooms, and area population. The goal is to build a machine learning model that can accurately estimate the price of a house given these features.

⚙️ Functionality

  • 📥 Load and clean the dataset.
  • 📊 Visualize the data to understand relationships between features.
  • 🤖 Build and evaluate a linear regression model.
  • 🔮 Predict house prices based on new input values.
  • 📈 Provide visualizations to help understand the model's performance.

🛠️ Tools Used

  • Python: Programming language used for data analysis and machine learning.
  • Pandas: Library for data manipulation and analysis.
  • NumPy: Library for numerical computations.
  • Matplotlib: Library for creating static, animated, and interactive visualizations.
  • Seaborn: Library for statistical data visualization.
  • Scikit-learn: Library for machine learning.

📝 Development Process

  1. Data Loading and Cleaning:

    • Load the dataset using Pandas.
    • Check for missing values and clean the data.
    • Remove unnecessary columns (e.g., Address).
  2. Data Visualization:

    • Visualize the distribution of house prices.
    • Create a correlation heatmap to understand relationships between features.
    • Generate pair plots, box plots, and regression plots to explore data.
  3. Model Building and Evaluation:

    • Normalize and scale the data.
    • Split the data into training and testing sets.
    • Build and evaluate a linear regression model.
  4. Prediction:

    • Create a function to predict house prices based on new input values.
    • Test the model with example input values.

📊 Results

  • Linear Regression:
    • Mean Squared Error: 10068422551.400879
    • Root Mean Squared Error: 100341.52954485435
    • Mean Absolute Error: 81135.56609336878
    • Mean Absolute Percentage Error: 0.07336544896281169
    • R^2 Score: 0.9146818498754016
    • Explained Variance Score: 0.9147412103528018

📈 Visualizations

  1. Distribution of House Prices
  2. Correlation Heatmap
  3. Pairplot of Features
  4. Boxplot of House Prices by Number of Bedrooms
  5. Regression Plots
    • House Prices vs. Average Area Income
    • House Prices vs. House Age
    • House Prices vs. Area Population
  6. Countplot of Number of Bedrooms:
  7. Predictions vs Actual Values
  8. Residuals Plot
  9. Distribution of Residuals
  10. Errors vs Actual Values
  11. Percentage Errors vs Actual Values

🧪 Manual Testing

To manually test the model, you can use the predict_house_price function to input new values and get the predicted house price.

📂 Project Structure

  • The project is organized as follows:
    • Data
    • Notebook

📌 Conclusions

  • The Linear Regression model performed well in terms of accuracy and explained variance.
  • Visualizations helped in understanding the relationships between features and the target variable.
  • Manual testing allows for easy prediction of house prices based on new input values.

📞 Contact

About

A machine learning project to predict house prices based on features like income, house age, number of rooms, bedrooms, and population. Utilizes linear regression for accurate price estimation and includes comprehensive visualizations for data insights.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published