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 |
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.
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.
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
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.
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
The training script uses a reproducible scikit-learn workflow:
train_test_split(test_size=0.2, random_state=42, stratify=y)ColumnTransformerpreprocessingOneHotEncoder(handle_unknown="ignore")for categorical featuresStandardScaler()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.
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
Install dependencies:
pip install -r requirements.txtGenerate the synthetic/sample dataset:
python src/generate_synthetic_data.pyTrain and evaluate models:
python src/train_model.pyRun one sample prediction:
python src/predict_sample.pyLaunch the Streamlit dashboard:
streamlit run app/streamlit_app.pyAfter 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.
- 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.
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.
Peyami Kenanoğlu
- GitHub: github.com/peyamikenanoglu