Profiles¶
What profile() finds in the data. ForecastingProfile is the object you pass to plan(), create_cv() and ask(): it holds summary statistics of the dataset (a DataProfile), the significant lags of each series and the recommended forecaster and estimator, never the observations themselves.
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: PickleDefaultsMixin, 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
|
n_observations_display |
int
|
Task-agnostic observation count for display and summaries: the
series length for a single series, |
time_zone |
str, default None
|
Name of the time zone of the dates ( |
span_start_date |
(str, None)
|
First date of the span of |
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 input was in ascending date order (within each series,
for long format). Rows out of order are sorted before profiling,
with a note in |
has_gaps |
bool, default False
|
Whether the datetime index has missing timestamps within its range (in long format, whether any series has them within its own range). |
has_duplicate_timestamps |
bool, default False
|
Whether some timestamps appear in several identical rows, which the
generated code drops. Timestamps repeated with different values
raise a |
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. |
unused_columns |
list, default []
|
Columns of the data that are neither the target, the date, the
series id nor an exogenous variable: left out with |
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 |
csv_sep |
str, default ','
|
Separator of the fields of the CSV file of |
csv_decimal |
str, default '.'
|
Decimal mark of the CSV file of |
warnings |
list
|
Human-readable warnings generated during profiling. |
Attributes¶
categorical_exog
class-attribute
instance-attribute
¶
categorical_exog = Field(default_factory=list)
span_start_date
property
¶
span_start_date
First date of the span of the data, where span_index_length
starts.
It is start_date, except in long format, where start_date is
the latest first date of the series and the span starts at the
earliest one (the union index of the series). The earliest is
taken only when span_index_length observations at frequency
run from it to the last date of the series; otherwise (a span
counted as the longest series, dates that mix time zones) it is
start_date, as before.
Returns:
| Name | Type | Description |
|---|---|---|
span_start_date |
(str, None)
|
First date of the span, or None without dates. |
n_observations_display
property
¶
n_observations_display
Task-agnostic observation count for display and summaries.
Returns the series length for single-series data and the union
span (span_index_length) for multi-series data.
Returns:
| Name | Type | Description |
|---|---|---|
n_observations |
int
|
Representative observation count for display. |
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: PickleDefaultsMixin, DisplayMixin, ExplainableResult, 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 estimator: a scikit-learn compatible estimator name,
|
estimator_candidates |
list
|
Ordered list of compatible estimator names. Empty for the baseline. |
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. |