This project implements a complete end-to-end data and machine learning pipeline for predicting house prices using the Ames Housing dataset.
The project is divided into two phases:
- Phase 1: Data engineering pipeline (ingestion, ETL, EDA, feature engineering)
- Phase 2: Machine learning and MLOps pipeline (model training, validation, deployment, automation)
The overall workflow is:
Raw Data → ETL → Processed Data → EDA → Feature Engineering → Model Training → Evaluation → Model Registration → Deployment → DevOps Automation
The Ames Housing dataset was obtained from Kaggle and uploaded as a CSV file to Azure Data Lake Storage Gen2.
- Storage container:
raw - Ingestion mode: batch
- The raw dataset is preserved in its original format to ensure reproducibility and traceability.
The ETL pipeline was implemented in Databricks using PySpark.
Main steps:
- reading the raw CSV file from the
rawcontainer - removing duplicate records
- dropping rows with missing target values (
SalePrice) - imputing missing numerical values using the column mean
- filling missing categorical values with
"Unknown" - ensuring schema consistency
- saving the cleaned dataset in Parquet format to the
processedcontainer
Validation checks performed:
- null value inspection across all columns
- row count verification
- duplicate validation
Datasets were registered in Databricks Hive Metastore:
hive_metastore.ames_schema.ames_rawhive_metastore.ames_schema.ames_processedhive_metastore.ames_schema.ames_features
This provides:
- basic data lineage
- metadata tracking
- structured access to datasets
EDA was performed to understand relationships between features and the target variable.
Key findings:
SalePriceis right-skewed- strong positive correlation with:
Gr_Liv_AreaOverall_Qual
- moderate correlation with:
Garage_AreaTotal_Bsmt_SF
- presence of outliers in large properties
- neighborhood has a strong impact on price
Risks identified:
- skewed target distribution
- potential multicollinearity among size-related variables
Feature engineering was applied to prepare data for modeling.
Engineered feature:
Age = Yr_Sold - Year_Built
Selected features:
Gr_Liv_AreaGarage_AreaTotal_Bsmt_SFAgeOverall_Qual
Features were assembled and scaled, and the final dataset was stored in the features container.
The data lake was organized into three layers:
raw→ original dataprocessed→ cleaned datafeatures→ machine learning-ready dataset
This structure improves traceability and aligns with data engineering best practices.
A regression model was developed to predict house prices.
Selected model:
- Random Forest Regressor
Reason for selection:
- strong performance on structured data
- ability to model nonlinear relationships
- robustness to noise
The dataset was split into:
- training set
- validation set
- test set
Training workflow:
- model trained on training data
- validated using validation set
- final evaluation performed on test set
The model was evaluated using:
- RMSE (Root Mean Squared Error)
- MAE (Mean Absolute Error)
- R² Score
Results:
- the model outperformed the baseline
- prediction errors were significantly reduced
- relationships between features and price were captured effectively
The trained model was saved as:
model.pkl
The model was registered in Azure ML:
- Model Name:
ames-model
This enables:
- version control
- reproducibility
- centralized model management
The model was deployed using Azure ML Managed Online Endpoint.
Deployment details:
- Endpoint Name:
ames-endpoint-03 - Deployment Name:
blue - Compute Type: Standard_DS2_v2
A scoring script was implemented to:
- load the model at runtime
- process incoming JSON requests
- generate predictions
- return results as JSON
The endpoint was tested successfully.
Sample input:
{
"data": [
{
"Gr_Liv_Area": 1500,
"Garage_Area": 400,
"Total_Bsmt_SF": 800,
"Age": 20,
"Overall_Qual": 6
}
]
}