PV Set-Point XGBoost
power set-point forecasting for solar inverters
2 min readupdated
A set of 12 models based on the XGBoost gradient boosting algorithm by author sahalhes for predicting operating parameters of solar power plants. Using 12 input weather and grid features, the models calculate a single value: the active power set-point P (in kW) or reactive power set-point Q (in kVAR) for each of 6 inverters ranging from 5.0 to 7.0 kW. The release reproduces the research paper arXiv:2412.01054, includes ready-made exports in ONNX (a universal format for fast model deployment without depending on the original library), and is useful for power engineers and microgrid management system developers.
Key features
- 12 specialized models: a pair of regressors (
_Pand_Q) for six sources (70, 79, 93, 218, 213, and 73) in JSON and ONNX formats. - 12 input features: current, facility voltage, temperature, humidity, three solar radiation metrics (GHI, DHI, GTI), wind speed and direction, precipitation, and the sine/cosine of the hour.
- High accuracy: on the test set, the XGBoost models achieve an R² coefficient of determination above 0.9999 and outperform baseline SVM and linear regression.
- Microsecond inference: ONNX versions perform a single calculation on a CPU in 10–17 microseconds with a deviation of no more than 1.4e-5 compared to native XGBoost.
What you can do
- Integrate into controllers and SCADA systems: use lightweight ONNX files via
onnxruntimeon a CPU to calculate inverter set-points in real time. - Test voltage regulation pipelines: test reactive power regulation algorithms based on the Volt-VAR curve using the open DKASC Alice Springs dataset.
- Benchmark custom models: use the published XGBoost, SVM, and linear regression metrics as a baseline when developing generation forecasting.
Example
import numpy as np
import onnxruntime as ort
x = np.array([[1.5, 241.2, 22.0, 30.0, 800.0, 90.0, 870.0, 0.0, 120.0, 0.0, 0.5, -0.87]], dtype=np.float32)
sess = ort.InferenceSession('70_P.onnx', providers=['CPUExecutionProvider'])
p = sess.run(['variable'], {'float_input': x})[0]
print(p)
Read more
DetailsTrained on DKASC Alice Springs data for May–June 2024 (15-minute daytime intervals: 2,334 rows in train and 584 in test per model).
MAPE metric (NRMSE from nominal power): 0.1488–0.2642% for P and 0.0312–0.0329% for Q; the entire batch of 584 rows is processed in ~2–4 ms on a CPU.
Important limitation: the original DKASC data lacks reactive power measurements, so the target variable Q is synthetic and calculated using the Volt-VAR formula from voltage.










Comments