Problem definitionUnderstanding the data Model designBusiness decisions
1 / 15
END-TO-END ML CASE STUDY

For consistent estimates, budget control, and profitability
Predicting construction project costs

A record of reframing the assigned problem in business terms and validating decisions with data — a report organized around the decision it must support

≈0
Cost of imputation — measured RMSE gap (933 ↔ 4,043)
0 models
Models compared in actual runs (8 classic + 5 recent)
0 rows
Real-world validation (gas-turbine NOx)
← → navigate · r replay · t theme · ? help
Problem definition

Start by explaining why this analysis is needed

I reframed the assigned construction-cost prediction task as a business problem I would own.

Q1 Why is it needed?Reduce estimate errors, budget overruns, and profit erosion — make estimating decisions more objective
Q2 What is predicted?Final estimated amount Total_Estimate (continuous → supervised regression)
Q3 Where is it used?Early estimate reviews · budget simulations · risk assessment
The real difficultyThe central challenge is missing-value imputation, more than model choice — 5% missingness dominates performance (measured on slide 6)
“This analysis predicts final estimates from cost drivers and reports the conditions and magnitude of prediction errors to make estimating decisions more objective.” The opening problem statement connects directly to the conclusion on slide 14
Source: decision-first report design principles
Understanding the data

Data describe the problem’s structure, beyond a list of variables

Construction Estimation Data — 1,000 rows × 6 columns, train 800 / test 200 (random_state=42)

Input variables XMaterial cost · labor cost · profit rate (10–30%) · discount/markup+ 3 domain-derived features (base cost, cost ratio, profit amount) = 7 features
Regression modelLearn the relationship between cost drivers and estimates
Target variable yFinal estimated amount Total_Estimate
Total_Estimate = (Material_Cost + Labor_Cost) × (1 + Profit_Rate/100) + Discount_or_Markup The generating formula stated in the dataset specification makes this deterministic data and anchors all subsequent interpretation
ColumnMeaningNotes
Material_CostMaterial cost5% missing (54 rows)
Labor_CostLabor cost5% missing (51 rows)
Profit_RateProfit rate (10·15·20·25·30%)Discrete values
Discount_or_MarkupDiscount (−) / markup (+) adjustment—
Policy_ReasonReason for policy adjustmentConfirmed uninformative → excluded from modeling
Total_EstimateFinal estimated amountPrediction target y
Source: dataset specification (including generating formula) · missing-value counts in EDA notebook
Understanding the dataEDA

Each visualization answers “What does this tell us?”

Only the three findings that informed decisions are reported here. See the analysis notebook for the full EDA.

Correlation with target (Pearson r)

Material_Cost0.80
Labor_Cost0.50
Discount_or_Markup0.33
Profit_Rate0.17

Material_Cost 0.80 = strongest correlation — informs feature selection and coefficient interpretation

Missing values are real — 5%

Each of four numeric columns has 5% missing values → a signal that the handling strategy determines performance (slides 5–6)

The formula is recovered — error ≈ 2.5×10⁻¹¹

The maximum error when recalculated with the stated formula is effectively zero → deterministic data without noise. The challenge is data quality rather than discovering the relationship.

Outliers are structural

Large amounts correspond to large projects (valid observations) → the decision was to retain them and explain them with the model instead of removing them

Source: EDA notebook outputs · domain-feature research notes (r=0.7989/0.4972/0.3251/0.1724)
Understanding the dataPreprocessing strategy

Explain why each preprocessing choice was made

Preprocessing designs a representation that models can learn from — three decisions.

① 5% missing → retain median imputation

For the 5% missing values (Material: 54 rows; Labor: 51), deletion or formula-based reconstruction was possible. I retained imputation because real data have gaps and missing rows often cannot be discarded in practice. The cost of that choice is measured and reported next.

② Fit preprocessing only on training data

All imputation medians and scalers are fitted on 800 training rows, then applied unchanged to test data. Fitting on the full dataset before splitting would leak test information. No such violations occur in the pipeline.

③ Seven features after derivation

Domain knowledge of the formula yields Total_Base_Cost, Cost_Ratio, and Profit_Amount. Their contribution is measured experimentally: LR +1.91%, RF +5.82% (ablation, 4→7 features).

Raw Data5% missing · 4 original features
→
Clean DataMedian imputation (training data only)
→
Model Ready3 derived features · scaling for linear models
→
Validationtrain 800 / test 200 · 5-fold CV
Source: preprocessing notebook cells · ablation outputs (RMSE_4feat→RMSE_7feat)
Understanding the dataKey decision

Measuring the cost of a preprocessing choice — ≈3,000 RMSE

A realistic preprocessing choice was made, and its cost was quantified.

Complete original data (exploratory upper bound)0
Selected track (5% missing + imputation)0
Gap ≈3,110 = cost of imputation
Imputation alone (reproduction experiment)0

933.34 and 6,925.35: reproduction with 4 original features / 4,043.42: selected 7-feature track — all use the same split (random_state=42)

The dominant source of the gap: imputation

With the same split (rs=42), adding only 5% missingness and median imputation raises RMSE from 933 to 6,925. Imputation accounts for most of the error, rather than factors such as feature-derivation order (confirmed by the red-team reproduction).

Business implication

Prioritize data collection and consistency — preventing missingness at source over model complexity. With complete data, a linear model alone can reach RMSE ~933.

Source: results/defense_checks.json (decomposition: 933.34 → 6925.35) · modeling notebook commentary
Model design

Build a comparison framework, rather than fitting just one model

Baseline → Compare → Improve. This time, the baseline won.

Baseline · Linear Regression

5-fold CV
R² 0.9673 ± 0.0124
RMSE 3,104.07 ± 592.65
MAE 1,081.00

Compare · Random Forest

5-fold CV
R² 0.9403 ± 0.0133
RMSE 4,242.82 ± 447.79
MAE 2,803.35

Improve · RF GridSearchCV

27 combinations × 5-fold
best: n_estimators 200 · max_depth 20 · min_samples_split 2
CV RMSE 4,226.53 (improvement +16)

Holdout (200 rows): Linear 4,043.42 versus tuned RF 4,378.07 — a gap of 334.65 (≈8%). The data are quasi-linear, and imputation noise offsets the advantage of tree splits → the simpler model had a structural advantage.
Linear4,043.42
Tuned RF4,378.07
The comparison explains why this model fits the task. It is consistent with the finding that data quality (≈3,000) matters more than tuning (+16).

A broader comparison gave the same result: Poly(deg2) 4,014.37 · Ridge 4,043.43 · GBR 4,396.09 — best improvement +0.7% at most (measured on the combined 7-feature leaderboard)

Source: modeling notebook · expanded leaderboard outputs (all measured)
Model designEvaluation and interpretation

Explain regression through three metrics

Final model: Linear Regression, 200-row holdout. The numbers also need an interpretation.

0
R² · explained variation — explains 94.3% of estimate variation; sufficient for early review
0
MAE · average error — more than half of predictions fall within this level
0
RMSE · sensitive to large errors — 2.9 times MAE, indicating a few large failures

What RMSE ≫ MAE tells us

Errors are uneven and concentrated in a small number of imputed rows — the spike near zero and heavy tails in the residual distribution below support this. Operational rule: review previously missing records individually.

Actual vs. predicted scatterplot and residual histogram (bottom two panels of dashboard.png)

Actual execution output — bottom two panels of data/dashboard.png (actual vs. predicted · residual distribution)

Overfitting diagnosis

Training and validation learning curves converge; errors in imputed rows also explain the gap between CV (3,104) and holdout (4,043) → no overfitting identified. The gap was checked using the principle that a large train/test discrepancy warrants investigation.

Learning curve — converging training/validation RMSE

Actual execution output — learning curves from the modeling notebook (LR · tuned RF)

Source: modeling notebook outputs (R² 0.943371 · MAE 1,407.42 · RMSE 4,043.417497)
Model designExtension ① Eight classic models

Data structure determines model rankings

All eight classic models measured on reconstructed complete data, with the same 800/200 split — Test RMSE.

View as table
ModelTest RMSEMAER²
Polynomial (deg2)0.000.001.000000
Linear933.34624.790.996983
Lasso933.34624.790.996983
Ridge933.37624.830.996982
ElasticNet936.53628.110.996962
XGBoost1,254.60965.760.994548
RandomForest2,710.372,097.050.974555
DecisionTree5,019.123,856.490.912744

Polynomial RMSE 0.00 is not leakage

The formula contains the quadratic interaction (M+L)×PR → degree 2 recovers the generating formula (recalculation error 1.1×10⁻¹¹).

Four linear models are statistically tied

All bootstrap 95% CIs (2,000 resamples) overlap [~800, ~1,065]. Ranking them by decimal-place differences is not meaningful.

Source: results/classic_results.json · leaderboard_classic.csv · defense_checks.json
Model designExtension ② Feature engineering

The domain formula is the strongest feature

Hold Ridge fixed and expand only the feature set from 4 to 8 — Test RMSE changes dramatically.

FS0: 4 original features933.37
FS1: +total cost933.35
FS2: +domain features0.11 Key: linearizing the multiplication term
FS3: +formula approximation0.09

Trees improved only slightly in the same experiment (RF 2,710→2,394). Linear models benefit most from the derived features.

Measured recovered coefficients: Material 1.192 (theory 1.197) · Labor 1.190 (1.197) · Profit_Rate 474.494 (474.751) · Discount 1.000 (exact) — the model recovered the formula

View as table
Feature setRidgeRandomForestXGBoost
FS0 (4 features)933.372,710.371,254.60
FS1 (+total)933.352,412.07981.20
FS2 (+domain)0.112,430.221,011.47
FS3 (+formula approximation)0.092,393.88865.78

Ridge Test RMSE

933.37

933.37 → 0.11 — once the multiplication term is known, regression becomes arithmetic.
knowledge injection (domain knowledge) differs from test leakage: features are calculated per row without training-set statistics.

Source: results/feature_set_comparison_day5.csv (all Ridge FS0–FS3 · RF · XGB results)
Model designExtension ③ Recent methods (2024–2026)

Recent methods need a culture of verification

Five methods were run following deep-research recommendations (105 agents, citations checked). The MLX transformer was built locally on a MacMini M4 Pro (Apple Silicon). Four original features; Test RMSE.

TabPFN v2197.39
MLX Transformer (PLE)223.90
MLX Transformer (linear)423.23
MLP (sklearn)992.71
LLM LoRA (Qwen2.5-0.5B)3,571.01

TabPFN’s 197.39 is conditional — 1,000 rows fall within its sweet spot (≤10k). At 36,733 real-world rows, subsampling is required and the rankings reverse (next slide).

View as table
ModelRMSEMAER²Training (s)
TabPFN v2197.3971.390.9998658.46
MLX TF (PLE)223.90162.460.9998269.04
MLX TF (linear)423.23300.880.9993805.47
MLP sklearn992.71763.560.99658713.37
LLM LoRA3,571.012,745.300.955830181.04

Initial conclusion (wrong)

6,370.74

“PLE embeddings underperform, contrary to the literature” — plausible but incorrect

A quality gate overturned the conclusion

6,370.74 → 223.90

Adversarial verification found an implementation defect: shared per-feature projections erased feature identity. After correction, the literature’s recommendation was reproduced. Implementation details can determine conclusions about a method

Source: results/modern_*.json (gate history in PLE notes) · research/modern_methods_report.md
Model designReal-world validation · gas-turbine NOx

Random splitting was a mirage — future-period prediction is the real test

The same methods applied to 36,733 UCI gas-turbine rows (2011–15) — NOx prediction RMSE (mg/m³), the same models with two splits.

E1 random splitE2 future-period test (train 2011–13 → predict 2014–15)
View as table
ModelE1 randomE2 future-periodGap
Ridge7.56010.119+2.56
Linear7.55910.127+2.57
RandomForest3.91012.645+8.74
MLX-PLE4.03012.700+8.67
TabPFN v23.71512.838+9.12
XGBoost3.89913.055+9.16
Polynomial5.57722.472+16.90

The 7 models shown represent both splits (all 11 are in results/gasturbine). Polynomial: synthetic RMSE 0.00 (formula recovery) becomes 22.47, the worst result — on real future-period data, polynomial regression falters without a generating formula

Rankings reverse

TabPFN 3.715 and XGB 3.899 lead on E1. On E2, both fall to around 12–13, while Ridge leads at 10.119. XGB moves from CV 3.78 to Test 13.06, quantifying the added optimism of random CV.

Reporting failure honestly

Against the success criterion (≤5 mg/m³), E2 falls short. Even measured oracle bias correction yields 7.681, still missing the criterion. The proposed response is annual retraining and drift monitoring (Ridge RMSE by year: 2014 8.62 → 2015 11.39).

Source: results/gasturbine/classic_results.json · modern_results.json · defense_checks.json (oracle 7.681)
Business decisions

Connect model results to business use

Model selection considered performance, interpretability, and practical use together.

Selected: Linear Regression

① Best holdout performance (4,043) ② Coefficients provide explanations: read the effect of a 1-won material-cost increase directly ③ Minimal retraining and deployment costs. Experiments showed that the added complexity of trees did not pay off on this data.

Three uses

① Early estimate review — immediate output from four inputs, with average error MAE ≈1,407 ② Budget simulation — profit-rate and discount scenarios (coefficient-based what-if analysis) ③ Risk assessment — prioritize large prediction/actual gaps (residual tails at ±20,000); flag imputed records separately.

Investment priority

Tuning improves RMSE by +16; eliminating missingness improves it by ≈3,000 → invest next in data collection and consistency. Real gas-turbine data additionally require a response to temporal drift, including retraining frequency.

Tuning gain+16
Data-quality gain≈3,000
Gas-turbine data tested whether conclusions from the educational dataset held in practice. The resulting operational principle: evaluation protocol and split design matter more than a performance headline.
Source: modeling notebook conclusion · defense_checks.json · full gas-turbine results
Business decisionsLimits and conclusion

A useful report also states limits and improvements

Limits

  • Educational, deterministic data lack real-site noise and nonlinearity
  • No variables for scale, location, construction activity, or contract conditions
  • Missingness is assumed completely at random (MCAR); patterned missingness would require a different imputation strategy
  • Real-world gas-turbine validation misses the future-period criterion (≤5)

Improvements

  • Collect site variables (scale, location, activity, contract)
  • Prevent missingness at source through input-system consistency — expected gain ≈3,000 RMSE
  • Drift monitoring + annual retraining
  • Flag imputed records for individual review
Predict final estimates from cost drivers to make estimating decisions more objective — the opening problem statement. The conclusion combines R² 0.94 predictions with an understanding of when errors occur and how large they are. That is the report’s final contribution. Returns to the problem definition on slide 2
✓ Is the problem defined in business terms?
✓ Does each EDA finding include an interpretation?
✓ Is the model choice clearly justified?
✓ Are evaluation metrics explained accurately?
✓ Are business uses and limitations stated?
✓ (Additional check) Does every figure match the execution-output record? None invented.
Five decision-first reporting checks + one additional quality gate
AppendixAnticipated questions, tested in advance

Difficult questions addressed early — selected from 35 red-team flags

With many peers solving the same task, ambiguous claims were checked proactively through six adversarial lenses. Every answer is backed by measured evidence.

Q. Is polynomial RMSE 0 caused by overfitting or leakage?No — it recovers the generating formula’s quadratic terms. Recalculation error is 1.1×10⁻¹¹; derivation uses no training statistics and does not meet the definition of leakage.
Q. Which is real: 933 or 4,043?Both. 933 is the complete-data upper bound; 4,043 is the selected track retaining imputation. A reproduction experiment (6,925) isolates imputation as the dominant source of the gap.
Q. Are ranking differences among the four linear models meaningful?No — all bootstrap 95% CIs overlap, making them statistically tied. The conclusion is a tied group of linear models, not a ranking.
Q. Does the gas-turbine E1 test also have a problem?Yes. Temporal autocorrelation may cause leakage, so E2 (future-period prediction) is the main test. The oracle-corrected 7.681 also misses the criterion and is reported as such.
4 notebooks · 0 errors2 dashboards12-page report PDF (decision-first structure) deep-research: 105 agentsRed team: 6 lenses, 35 flags3 defense experiments All figures = results/ record
Source: research/redteam_flags.json (all 7 Q&As) · defense_checks.json
Construction-cost prediction ML case study · 2026 · Jinhyun An