MCPcopy Create free account
hub / github.com/kwuking/TimeMixer / WeekOfYear

Class WeekOfYear

utils/timefeatures.py:77–81  ·  view source on GitHub ↗

Week of year encoded as value between [-0.5, 0.5]

Source from the content-addressed store, hash-verified

75
76
77class WeekOfYear(TimeFeature):
78 """Week of year encoded as value between [-0.5, 0.5]"""
79
80 def __call__(self, index: pd.DatetimeIndex) -> np.ndarray:
81 return (index.isocalendar().week - 1) / 52.0 - 0.5
82
83
84def time_features_from_frequency_str(freq_str: str) -> List[TimeFeature]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected