Skip to content

Krepseliss/Applied-Deep-Learning-AI-Assignment-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏑 House Price Prediction - Neural Network Model

πŸ“Œ Project Overview

This project focuses on building a Neural Network Model using PyTorch to predict house prices based on key property features. We started from raw data, performed feature engineering, data preprocessing, model training, and evaluation using RMSE (Root Mean Squared Error).

πŸ“Š Dataset Used

  • The dataset contains various features related to house attributes such as square footage, number of rooms, garage size, year built, and neighborhood.
  • The target variable (SalePrice) represents the actual selling price of the houses.

πŸ› οΈ Steps Completed

βœ… 1. Data Preprocessing

  • Selected the most relevant features for price prediction.

  • Added a new feature: TotalSF (Total Square Footage), calculated as:

  • One-hot encoded categorical variables (Neighborhood, KitchenQual).

  • Standardized all numerical features using StandardScaler() to improve model performance.

  • Split dataset into training (80%) and validation (20%).

βœ… 2. Neural Network Model in PyTorch

  • Built a Multi-Layer Perceptron (MLP) with:
  • Batch Normalization for stable training.
  • ReLU Activation for non-linearity.
  • Dropout Layers to prevent overfitting.
  • Adam Optimizer for efficient weight updates.
  • Defined Loss Function (MSELoss) for regression.

βœ… 3. Model Training

  • Implemented Early Stopping to prevent overfitting.
  • Used ReduceLROnPlateau to dynamically adjust learning rate.
  • Trained the model for up to 100 epochs, stopping early when validation loss stopped improving.

βœ… 4. Evaluation & RMSE Calculation

  • Converted predictions back to the original price scale using StandardScaler.inverse_transform().
  • Computed RMSE (Root Mean Squared Error) to measure model accuracy.

βœ… 5. Model Improvement & Testing

  • Compared RMSE before and after adding TotalSF.
  • Adjusted learning rate, dropout, and batch size to optimize model performance.

πŸš€ How to Run the Model

  1. Ensure you have Python, PyTorch, pandas, and scikit-learn installed.
  2. Load the dataset (train.csv, test.csv).
  3. Run preprocessing.py to prepare the data.
  4. Train the model using train.py.
  5. Evaluate predictions and check the RMSE.

πŸ”₯ Key Takeaways

βœ… Feature Engineering matters – Adding TotalSF improved predictions.
βœ… Neural Networks work for regression, but tuning is key.
βœ… Early Stopping & LR Scheduling help prevent overfitting.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published