Back to projects
Machine Learning · Energy

Combined Cycle Power Plant Energy Prediction

Predict the net hourly electrical output (MW) of a combined cycle power plant from four ambient sensor readings, using the actual trained XGBoost model.

PythonXGBoostPandasNumPySciPyScikit-learnStreamlitReactTypeScript
Live demo

Energy output predictor

Move the sliders — every prediction is produced by the trained booster, updating instantly.

Plant conditions

1.81Higher temperature reduces turbine efficiency and output.37.11
25.36Steam-turbine backpressure; strongly correlated with output.81.56
992.89Atmospheric pressure at the plant intake.1033.30
25.56Moisture in the intake air, affects cooling performance.100.16
Live prediction

Predicted net hourly energy output

455.23MW

420.3 MWdataset range495.8 MW

vs dataset mean

+0.87 MW

Dataset mean

454.37 MW

Model MAE

± 2.24 MW

Test R²

0.9632

Feature importance

Gain-based importance from the trained XGBoost booster.

Ambient Temperature90.8%
Exhaust Vacuum5.8%
Ambient Pressure1.7%
Relative Humidity1.7%
Model information

Performance on held-out data

R² Score

0.9632

MAE

2.238 MW

RMSE

3.249 MW

MSE

10.559

Training R²

0.9887

Boosted trees

100

Training rows

7,608

Test rows

1,902

How it works

A combined cycle power plant pairs gas and steam turbines. Its net hourly electrical output depends heavily on ambient conditions — mainly temperature and the steam turbine's exhaust vacuum.

The original project trains an XGBoost regressor on the UCI dataset after removing outliers with a z-score filter. That exact pipeline was re-run to produce this demo, and the resulting booster (100 trees) was exported to JSON.

The browser walks those trees directly, so what you see here is the real model — identical to model.predict() in Python to within floating-point precision, with no server round-trip.

Pipeline

  1. 1Dataset9,568 hourly observations from the UCI Combined Cycle Power Plant dataset.
  2. 2CleaningZ-score (>3) outlier removal on humidity and pressure leaves 9,510 rows.
  3. 3Split80 / 20 train-test split — 7,608 train, 1,902 test rows.
  4. 4ModelXGBRegressor (random_state=42) with 100 boosted trees.
  5. 5ExportBooster trees, metrics and gain importances exported to JSON.
  6. 6InferenceThe same trees are walked in TypeScript, so the browser reproduces XGBoost's prediction exactly.