Skip to content

Commit ff5ee02

Browse files
committed
formatting
1 parent ea7b37e commit ff5ee02

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

content/python_files/multiple_horizons_prediction.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,3 @@ def scoring(regressor, X, y):
322322
# of scores or computational cost. The trend of the scores along the horizon is also
323323
# different from the `HistGradientBoostingRegressor`: the scores worsen as the horizon
324324
# increases.
325-

content/python_files/prediction_intervals.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,7 @@
247247

248248
# %%
249249
plot_residuals_vs_predicted(cv_predictions_hgbr_50).interactive().properties(
250-
title=(
251-
"Residuals vs Predicted Values from cross-validation predictions for median"
252-
)
250+
title=("Residuals vs Predicted Values from cross-validation predictions for median")
253251
)
254252

255253
# %%
@@ -315,6 +313,7 @@
315313
# Now, we assess if the actual coverage of the models is close to the target coverage of
316314
# 90%. In addition, we compute the average width of the bands.
317315

316+
318317
# %%
319318
def coverage(y_true, y_quantile_low, y_quantile_high):
320319
y_true = np.asarray(y_true)
@@ -384,7 +383,11 @@ def mean_width(y_true, y_quantile_low, y_quantile_high):
384383
# %%
385384
ax = coverage_by_bin.boxplot(column="coverage", by="bin_label", whis=1000)
386385
ax.axhline(y=0.9, color="red", linestyle="--", label="Target coverage (0.9)")
387-
ax.set(xlabel="Load bins (MW)", ylabel="Coverage", title="Coverage Distribution by Load Bins")
386+
ax.set(
387+
xlabel="Load bins (MW)",
388+
ylabel="Coverage",
389+
title="Coverage Distribution by Load Bins",
390+
)
388391
ax.set_title("Coverage Distribution by Load Bins")
389392
ax.legend()
390393
plt.suptitle("") # Remove automatic suptitle from boxplot

content/python_files/single_horizon_prediction.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,12 @@
271271
# Those results show very good performance of the model: less than 3% of mean
272272
# absolute percentage error (MAPE) on the test folds. Similarly, all the
273273
# deviance scores are close to 1.0.
274-
#
274+
#
275275
# We observe a bit of variability in the scores across the different folds: in
276276
# particular the test performance on the first fold seems to be worse than the
277277
# other folds. This is likely due to the fact that the first fold contains
278278
# training data from 2021 and 2022 and the test data mostly from 2023.
279-
#
279+
#
280280
# The invasion in Ukraine and a sharp drop in nuclear electricity production
281281
# due to safety problems strongly impacted the distribution of the electricity
282282
# prices in 2022, with unprecedented high prices, which can in turn cause a
@@ -642,4 +642,3 @@
642642

643643
# %%
644644
# nested_cv_results_ridge.round(3)
645-

0 commit comments

Comments
 (0)