make_exogenous_regression¶
yohou.datasets._generators.make_exogenous_regression(*, n_samples=200, forecasting_horizon=6, noise=0.1, forecast_bias=0.5, random_state=42)
¶
Generate a synthetic regression dataset with exogenous features.
Creates hourly electricity prices driven by temperature and a holiday
indicator with a known linear relationship:
price = 50 + 2 * temperature + 10 * is_holiday + noise.
Three exogenous feature types are produced:
- X_actual (observation features): realized temperature readings with a 24 hour sinusoidal cycle.
- X_future (known future): a deterministic
is_holidayindicator (Sundays = 1.0) covering the full time range. - X_forecast (external forecasts): weather temperature forecasts
with one vintage per observation, each covering the next
forecasting_horizonsteps. Forecasts carry a small systematic bias relative to actuals.
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
n_samples
|
int
|
Number of hourly observations. |
200
|
forecasting_horizon
|
int
|
Number of forward steps per X_forecast vintage. |
6
|
noise
|
float
|
Standard deviation of the target noise term. |
0.1
|
forecast_bias
|
float
|
Systematic bias added to weather forecasts relative to actuals. |
0.5
|
random_state
|
int
|
Seed for reproducibility. |
42
|
Returns¶
| Type | Description |
|---|---|
Bunch
|
Dictionary-like object with the following attributes: y : pl.DataFrame
Target with columns |
See Also¶
make_exogenous_classification: Classification variant with categorical target.fetch_tourism_monthly: Real monthly tourism dataset (univariate).
Examples¶
>>> from yohou.datasets import make_exogenous_regression
>>> data = make_exogenous_regression(n_samples=100)
>>> data.y.columns
['time', 'price']
>>> data.X_forecast.columns
['vintage_time', 'time', 'wx_temp']
Source Code¶
Show/Hide source
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
Tutorials¶
The following example notebooks use this component:
-
How to Align Exogenous Features Across Pipeline Steps
Data-Features
Control which step-indexed columns each direct-strategy estimator sees using the step_feature_alignment parameter of PointReductionForecaster.
-
How to Produce Multi-Vintage Predictions
Forecasting-Models
Generate multiple predictions from different weather forecast vintages without refitting, using the X_forecast predict-time override.
-
Exogenous Features (X_actual, X_future, X_forecast)
Getting-Started
Build a forecasting model with actual observations, known-future indicators, and multi-vintage external forecasts on synthetic electricity price data.