This project aims to develop a linear regression model to predict house prices based on several key features: square footage, number of bedrooms, and number of bathrooms. Using a dataset that contains housing information, the model is trained and evaluated to assess its predictive power. This project demonstrates how linear regression can be applied to real-world data and how model evaluation techniques can be used to understand the model's performance.
- Data Loading and Preprocessing:
- Load the dataset and perform necessary data cleaning (e.g., handling missing values, encoding categorical variables if any).
- Exploratory Data Analysis (EDA):
- Visualize the data to understand relationships between features and house prices.
- Model Building:
- Use linear regression to model the relationship between house prices and the selected features (square footage, bedrooms, and bathrooms) and training the model.
- Model Evaluation:
- Calculate evaluation metrics like R² (coefficient of determination) and Mean Squared Error (MSE) to assess the model's performance.
- Plot the actual vs. predicted prices to visualize how well the model is performing.
- Result
- The model was able to predict house prices with reasonable accuracy. The actual vs. predicted prices plot shows that the model performs well, though some variance is present, particularly for higher-priced houses.