Merge branch 'master' of https://github.com/google-research/timesfm into rajat_dev
This commit is contained in:
@@ -50,13 +50,13 @@ def moving_average(arr, window_size):
|
|||||||
def freq_map(freq: str):
|
def freq_map(freq: str):
|
||||||
"""Returns the frequency map for the given frequency string."""
|
"""Returns the frequency map for the given frequency string."""
|
||||||
freq = str.upper(freq)
|
freq = str.upper(freq)
|
||||||
if (freq.endswith("H") or freq.endswith("T") or freq.endswith("MIN") or
|
if freq.endswith("MS"):
|
||||||
freq.endswith("D") or freq.endswith("B") or freq.endswith("U") or
|
|
||||||
freq.endswith("S")):
|
|
||||||
return 0
|
|
||||||
elif freq.endswith(("W", "M", "MS")):
|
|
||||||
return 1
|
return 1
|
||||||
elif freq.endswith("Y") or freq.endswith("Q") or freq.endswith("A"):
|
elif freq.endswith(("H", "T", "MIN", "D", "B", "U", "S")):
|
||||||
|
return 0
|
||||||
|
elif freq.endswith(("W", "M")):
|
||||||
|
return 1
|
||||||
|
elif freq.endswith(("Y", "Q", "A")):
|
||||||
return 2
|
return 2
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Invalid frequency: {freq}")
|
raise ValueError(f"Invalid frequency: {freq}")
|
||||||
|
|||||||
Reference in New Issue
Block a user