This project demonstrates a complete machine learning workflow for predicting house prices using the California Housing dataset. The notebook covers data loading, cleaning, exploratory data analysis (EDA), feature engineering, model training, evaluation, and hyperparameter tuning.
code.ipynb— Main Jupyter notebook with all code and analysishousing.csv— Dataset fileREADME.md— Project documentation
- Data Loading & Cleaning
- Load the dataset from CSV
- Check and handle missing values
- Exploratory Data Analysis (EDA)
- Visualize feature distributions
- Analyze correlations
- Visualize geographical data
- Feature Engineering
- Log-transform skewed features
- One-hot encode categorical variables
- Create new ratio features
- Model Training & Evaluation
- Linear Regression with feature scaling
- Random Forest Regressor
- Model evaluation on test set
- Hyperparameter Tuning
- GridSearchCV for Random Forest
- Selection and evaluation of the best model
- Clone the repository and navigate to the project folder:
git clone https://github.com/avi-poptani-003/House-Price-Prediction-ML-Project.git cd House-Price-Prediction-ML-Project - Set up a Python environment (recommended):
python -m venv env env\Scripts\activate # On Windows source env/bin/activate # On Mac/Linux
- Install dependencies:
pip install -r requirements.txt
- Start Jupyter Notebook:
jupyter notebook
- Open
code.ipynband run the cells sequentially.
- Python 3.8+
- pandas
- numpy
- matplotlib
- seaborn
- scikit-learn
You can generate a requirements.txt with:
pip freeze > requirements.txt- The notebook provides visualizations for EDA and feature relationships.
- Linear Regression and Random Forest models are trained and evaluated.
- Hyperparameter tuning is performed for optimal Random Forest performance.
- Clean, well-commented code with clear section explanations
- Robust handling of missing values and categorical data
- Feature engineering for improved model performance
- Reproducible results with fixed random seeds
This project is licensed under the MIT License.