make_exogenous_classification¶
yohou.datasets._generators.make_exogenous_classification(*, n_samples=400, forecasting_horizon=6, noise=0.1, forecast_bias=0.3, random_state=42)
¶
Generate a synthetic classification dataset with exogenous features.
Creates hourly air quality readings classified into three categories based on pollutant concentration thresholds.
Three exogenous feature types are produced:
- X_actual (observation features): realized pollutant readings with a 24 hour sinusoidal cycle.
- X_future (known future): a deterministic
is_weekendindicator covering the full time range. - X_forecast (external forecasts): pollutant concentration
forecasts with one vintage per observation, each covering the next
forecasting_horizonsteps.
Classification thresholds on the continuous pollutant signal:
"good": pollutant < 40"moderate": 40 <= pollutant < 60"poor": pollutant >= 60
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
n_samples
|
int
|
Number of hourly observations. |
400
|
forecasting_horizon
|
int
|
Number of forward steps per X_forecast vintage. |
6
|
noise
|
float
|
Standard deviation of the classification boundary noise. |
0.1
|
forecast_bias
|
float
|
Systematic bias added to pollutant forecasts relative to actuals. |
0.3
|
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_regression: Regression variant with continuous target.fetch_air_quality_classification: Real air quality classification dataset.
Examples¶
>>> from yohou.datasets import make_exogenous_classification
>>> data = make_exogenous_classification(n_samples=200)
>>> data.y.columns
['time', 'air_quality']
>>> sorted(data.classes)
['good', 'moderate', 'poor']
Source Code¶
Show/Hide source
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |