check_inputs¶
yohou.utils.validation.check_inputs(y, X_actual)
¶
Validate that target and feature DataFrames have consistent time intervals.
Ensures all input DataFrames (target y and exogenous features X_actual) have the same uniform time interval. This is required for proper alignment in forecasting operations.
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
y
|
DataFrame
|
Target time series with "time" column. |
required |
X_actual
|
DataFrame or None
|
Exogenous feature time series with "time" column, or None. |
required |
Returns¶
| Type | Description |
|---|---|
str
|
The common time interval shared by all provided DataFrames (e.g., "1d", "1mo"). |
Raises¶
| Type | Description |
|---|---|
ValueError
|
If any DataFrame has inconsistent intervals internally, or if the intervals don't match across DataFrames. |
Examples¶
>>> import polars as pl
>>> from datetime import datetime
>>> time_index = pl.datetime_range(
... start=datetime(2020, 1, 1), end=datetime(2020, 1, 5), interval="1d", eager=True
... )
>>> y = pl.DataFrame({"time": time_index, "sales": [100, 110, 120, 130, 140]})
>>> X_actual = pl.DataFrame({"time": time_index, "holiday": [0, 0, 1, 0, 0]})
>>> interval = check_inputs(y, X_actual)
>>> interval
'1d'
See Also¶
check_interval_consistency: Validates single DataFrame intervalsvalidate_column_names: Validates column names don't misuse __ separator