Skip to main content

Setup

dspriceunique_idprice2
02000-10-050.54881400.345011
12000-10-060.71518900.445598
22000-10-070.60276300.165147
32000-10-080.54488300.041373
42000-10-090.42365500.391577

transform_exog

Compute lag features for dynamic exogenous regressors. Parameters:
NameTypeDescriptionDefault
dfpandas or polars DataFrameDataframe with ids, times and values for the exogenous regressors.required
lagslist of intLags of the target to use as features. Defaults to None.None
lag_transformsdict of int to list of functionsMapping of target lags to their transformations. Defaults to None.None
id_colstrColumn that identifies each serie. Defaults to ‘unique_id’.‘unique_id’
time_colstrColumn that identifies each timestep, its values can be timestamps or integers. Defaults to ‘ds’.‘ds’
num_threadsintNumber of threads to use when computing the features. Use -1 to use all available CPU cores. Defaults to 1.1
Returns:
TypeDescription
pandas or polars DataFrameOriginal DataFrame with the computed features
dspriceunique_idprice2price_lag1price_lag2price_expanding_mean_lag1price2_lag1price2_lag2price2_expanding_mean_lag1
02000-10-050.54881400.345011NaNNaNNaNNaNNaNNaN
12000-10-060.71518900.4455980.548814NaN0.5488140.345011NaN0.345011
22000-10-070.60276300.1651470.7151890.5488140.6320010.4455980.3450110.395304
32000-10-080.54488300.0413730.6027630.7151890.6222550.1651470.4455980.318585
42000-10-090.42365500.3915770.5448830.6027630.6029120.0413730.1651470.249282
dspriceunique_idprice2price_lag1price_lag2price_expanding_mean_lag1price2_lag1price2_lag2price2_expanding_mean_lag1
datetime[ns]f64i64f64f64f64f64f64f64f64
2000-10-05 00:00:000.54881400.345011NaNNaNNaNNaNNaNNaN
2000-10-06 00:00:000.71518900.4455980.548814NaN0.5488140.345011NaN0.345011
2000-10-07 00:00:000.60276300.1651470.7151890.5488140.6320010.4455980.3450110.395304
2000-10-08 00:00:000.54488300.0413730.6027630.7151890.6222550.1651470.4455980.318585
2000-10-09 00:00:000.42365500.3915770.5448830.6027630.6029120.0413730.1651470.249282