paddlets.transform.time_feature
- class TimeFeatureGenerator(feature_cols: Optional[List[str]] = ['year', 'month', 'day', 'weekday', 'hour', 'quarter', 'dayofyear', 'weekofyear', 'is_holiday', 'is_workday'], extend_points: int = 0)[source]
Bases:
BaseTransformTransform time index into specific time features
- Parameters
feature_cols (str) – Name of feature columns to transform. Currently supported arg values are: year, month, day, weekday, hour, quarter, dayofyear, weekofyear, is_holiday, and is_workday. These time features will be generated by default
extend_points (int) – Extra time points need to be appended to the tail of the existing target time series. Only used when two scenarios are matched simultaneously: 1.the known covariates is None 2.the
predict()method is called. The reason is that thepredict()method usually requires the tail index of the future target; this index can be calculated from the known cov time series. If known cov is None, this future target tail index needs to be manually extended in this transform and appended to the target.
- Returns
None