Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Construction Delay Risk ML

30-Second Summary

Construction Delay Risk ML is a portfolio-safe machine learning demonstration for scoring schedule delay risk in construction projects. It uses synthetic/sample project data to show a practical workflow for construction analytics, project risk management, schedule delay risk scoring, and decision support without exposing confidential research or proprietary project records.

Item Summary
Problem Predict construction project delay risk level
Target delay_risk_level: low, medium, high
Data Synthetic/sample construction project records generated inside this repository
Modeling Scikit-learn classification pipelines with preprocessing, model comparison, and evaluation
Use case Risk scoring demonstration for construction analytics and project decision support
Scope Portfolio-oriented ML workflow, not a production delay prediction platform

Important Scope Note

This is a portfolio-safe machine learning demonstration inspired by construction delay risk analysis. It uses synthetic/sample data and does not include confidential thesis data, unpublished article results, or proprietary construction project records.

This repository should be read as an applied ML portfolio project. It is not the actual PhD thesis code, not a real-client system, and not a production deployment.

Business Problem

Construction projects can face delay risk from planning uncertainty, procurement problems, design changes, permit issues, labor availability, site-access constraints, contractor history, weather exposure, and project complexity.

This project demonstrates how a structured ML workflow can support a decision-support workflow by estimating whether a project has low, medium, or high delay risk. The output is a risk score/classification that could help prioritize review, monitoring, and mitigation planning in a construction analytics context.

Dataset Strategy

The project uses synthetic/sample data generated by src/generate_synthetic_data.py.

The synthetic generation logic is designed to reflect plausible construction delay drivers:

  • higher complexity, design changes, procurement delays, permit delays, weather risk, material volatility, past contractor delay rate, and poor site access increase delay risk;
  • higher labor availability, contractor experience, and schedule buffer reduce delay risk.

The generated dataset is saved to:

data/processed/synthetic_construction_delay_data.csv

Target Definition

The target variable is:

delay_risk_level

It is derived from the numeric delay_days field:

Class Rule
low delay_days <= 15
medium 16 <= delay_days <= 45
high delay_days > 45

During model training, both project_id and delay_days are removed from the feature set to avoid target leakage.

Feature Groups

The synthetic dataset includes planning, project, contractor, procurement, weather, labor, and execution-risk features:

  • project profile: project_type, contract_type, planned_duration_days, contract_value_musd
  • complexity and changes: project_complexity_score, design_change_count
  • approvals and procurement: procurement_delay_days, permit_delay_days
  • external risk: weather_risk_score, material_price_volatility
  • resource and access factors: labor_availability_score, site_access_score
  • contractor profile: contractor_experience_years, past_contractor_delay_rate, subcontractor_count
  • planning resilience: schedule_buffer_ratio

Modeling Approach

The training script uses a reproducible scikit-learn workflow:

  • train_test_split(test_size=0.2, random_state=42, stratify=y)
  • ColumnTransformer preprocessing
  • OneHotEncoder(handle_unknown="ignore") for categorical features
  • StandardScaler() for numeric features
  • model comparison using macro F1 as the selection metric

Models compared:

  • LogisticRegression(max_iter=1000, class_weight="balanced")
  • RandomForestClassifier(n_estimators=300, random_state=42, class_weight="balanced")
  • HistGradientBoostingClassifier(random_state=42)

The best model is saved locally for sample prediction and Streamlit demonstration.

Project Structure

construction-delay-risk-ml/
|-- README.md
|-- LICENSE
|-- requirements.txt
|-- .gitignore
|-- src/
|   |-- generate_synthetic_data.py
|   |-- train_model.py
|   `-- predict_sample.py
|-- app/
|   `-- streamlit_app.py
|-- data/
|   |-- raw/
|   |   `-- .gitkeep
|   `-- processed/
|       `-- .gitkeep
|-- models/
|   `-- .gitkeep
`-- reports/
    |-- figures/
    |   `-- .gitkeep
    `-- .gitkeep

How to Run

Install dependencies:

pip install -r requirements.txt

Generate the synthetic/sample dataset:

python src/generate_synthetic_data.py

Train and evaluate models:

python src/train_model.py

Run one sample prediction:

python src/predict_sample.py

Launch the Streamlit dashboard:

streamlit run app/streamlit_app.py

Expected Outputs

After running the data generation and training scripts, the repository will produce:

data/processed/synthetic_construction_delay_data.csv
models/delay_risk_model.joblib
reports/metrics.json
reports/sample_predictions.csv
reports/figures/confusion_matrix.png
reports/feature_importance.csv
reports/figures/feature_importance_top15.png

Feature-importance outputs are created only when the selected best model exposes feature importances.

Limitations

  • This project uses synthetic/sample data only.
  • It does not include confidential thesis data, unpublished article results, or proprietary construction records.
  • The model is trained on simulated relationships, so the results should not be interpreted as validated construction industry performance.
  • The Streamlit app is a demo interface, not a production delay prediction platform.
  • Real deployment would require validated project data, governance, monitoring, calibration, and domain review.

Next Improvements

Potential future improvements include:

  • richer synthetic data scenarios by construction sector and project phase;
  • probability calibration and threshold analysis;
  • SHAP or permutation-based model interpretation;
  • drift monitoring concept for changing project conditions;
  • FastAPI scoring endpoint;
  • Docker-based local deployment;
  • expanded dashboard pages for project portfolio risk review.

Author

Peyami Kenanoğlu

About

Portfolio-safe construction delay risk prediction system using synthetic data, scikit-learn pipelines, model evaluation, and Streamlit dashboard.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages