Profiles
skforecast_ai.schemas.profiles ¶
Classes:
| Name | Description |
|---|---|
SeriesLengthInfo |
Per-series index range and observation count. |
DataProfile |
Profile of the input time series dataset. |
SeriesPacf |
PACF-significant lags for a single series. |
ForecastingProfile |
High-level profile of the forecasting problem. |
Classes¶
SeriesLengthInfo ¶
Bases: BaseModel
Per-series index range and observation count.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
str, default None
|
First timestamp of the series as a string (e.g. |
end |
str, default None
|
Last timestamp of the series as a string. None when the index is not datetime. |
length |
int
|
Number of observations in the series. |
DataProfile ¶
Bases: BaseModel
Profile of the input time series dataset.
Attributes:
| Name | Type | Description |
|---|---|---|
data_format |
str, default 'single'
|
Layout of the dataset. One of |
n_series |
int
|
Number of individual time series. |
series_lengths |
dict
|
Mapping of series name to its |
span_index_length |
int
|
Length of the union datetime index spanning every series, from
the earliest start to the latest end at |
n_total_observations |
int
|
Pooled total number of observations across all series (the sum of
every series length). Computed automatically from
|
target |
(str, list)
|
Name(s) of the target column(s). A single string for single series and long format. A list of strings for wide format where each element is a series column. |
target_dtype |
str, default 'numeric'
|
Data type category of the target column. One of |
target_stats |
dict
|
Mapping of target column (or series name) to a dict with keys
|
missing_target |
dict
|
Mapping of target column (or series name) to count of NaN values. Only entries with at least one missing value are included. |
date_column |
str, default None
|
Name of the column containing timestamps. |
series_id_column |
str, default None
|
Name of the column identifying individual series. |
index_type |
str
|
Type of the DataFrame index. One of |
frequency |
str, default None
|
Inferred pandas frequency string (e.g. |
frequency_is_set |
bool, default False
|
Whether the index already has a frequency set ( |
index_is_monotonic |
bool, default True
|
Whether the index is sorted in ascending order. |
has_gaps |
bool, default False
|
Whether the datetime index has missing timestamps within its range. |
has_duplicate_timestamps |
bool, default False
|
Whether the index contains duplicate timestamps. |
exog_columns |
list
|
Names of exogenous predictor columns. |
categorical_exog |
list
|
Subset of |
missing_exog |
dict
|
Mapping of exogenous column name to count of missing values. Only columns with at least one missing value are included. |
data_path |
str, default 'data.csv'
|
Path to the source CSV file. Derived automatically during
profiling: if the input is a file path, this stores it; if the
input is a DataFrame, defaults to |
warnings |
list
|
Human-readable warnings generated during profiling. |
Attributes¶
categorical_exog
class-attribute
instance-attribute
¶
categorical_exog = Field(default_factory=list)
Functions¶
_coerce_series_lengths
classmethod
¶
_coerce_series_lengths(value)
Coerce int values into SeriesLengthInfo(length=int).
Source code in skforecast_ai/schemas/profiles.py
194 195 196 197 198 199 200 201 202 203 | |
_populate_observation_counts ¶
_populate_observation_counts()
Derive span_index_length and n_total_observations.
Source code in skforecast_ai/schemas/profiles.py
205 206 207 208 209 210 211 212 213 214 | |
SeriesPacf ¶
Bases: BaseModel
PACF-significant lags for a single series.
Attributes:
| Name | Type | Description |
|---|---|---|
series_id |
str
|
Name of the series (target column for single/wide, series id for long format). |
n_observations |
int
|
Number of non-NaN observations in the series (all NaNs, edge and interior, are excluded by the count). Used as the sample size for the PACF significance test. Not the raw column length. |
lags |
list of int
|
Significant lags retained by Benjamini-Hochberg FDR correction
and the minimum effect-size floor, ordered by descending |
pacf_abs |
list of float
|
Absolute PACF magnitude aligned element-wise with |
ForecastingProfile ¶
Bases: DisplayMixin, BaseModel
High-level profile of the forecasting problem.
Combines the dataset profile with the coarse modeling decisions:
which forecaster family to use, which estimator to pair with it,
and the alternative candidates the user could switch to. Detailed
configuration (lags, metric, intervals, NaN handling, preprocessing)
is left to ForecastPlan.
Attributes:
| Name | Type | Description |
|---|---|---|
data_profile |
DataProfile
|
Profile of the input dataset (independent of the forecasting decisions). |
task_type |
str
|
Forecasting task category implied by the selected forecaster.
One of |
forecaster |
str
|
Selected skforecast forecaster class name. |
forecaster_candidates |
list
|
Ordered list of compatible forecaster class names. The first item is the preferred default. |
estimator |
str, default None
|
Selected scikit-learn compatible estimator name. |
estimator_candidates |
list
|
Ordered list of compatible estimator names. Empty when the selected forecaster does not use an external estimator. |
series_pacf |
list of SeriesPacf
|
Per-series PACF-significant lags (the forecaster-invariant lag
primitive). Empty for statistical and foundation tasks. The
final lag set is derived in |
window_features |
list of dict, default None
|
Window feature configurations (dicts with keys |
calendar_features |
list of str, default None
|
Recommended calendar feature names (a subset of those supported
by |
explanation |
str
|
Human-readable explanation of why this forecaster + estimator combination was chosen. |
Attributes¶
forecaster_candidates
class-attribute
instance-attribute
¶
forecaster_candidates = Field(default_factory=list)
estimator_candidates
class-attribute
instance-attribute
¶
estimator_candidates = Field(default_factory=list)
Functions¶
_rich_body ¶
_rich_body(console, options)
Source code in skforecast_ai/schemas/profiles.py
315 316 | |
Functions¶
_resolve_observation_counts ¶
_resolve_observation_counts(series_lengths, frequency)
Resolve the span index length and the total number of observations.
Merges the two quantities the assistant needs from the per-series ranges: the length of the union datetime index that spans every series (used for lag, window, and cross-validation sizing) and the pooled total number of observations (used for estimator sizing).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
series_lengths
|
dict
|
Mapping of series name to its |
required |
frequency
|
str
|
Inferred pandas frequency string. When None, or when datetime bounds are missing, the span falls back to the longest individual series. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
span_index_length |
int
|
Number of observations in the union index from the earliest start
to the latest end at |
n_total_observations |
int
|
Sum of every series length. |
Source code in skforecast_ai/schemas/profiles.py
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 | |