This commit is contained in:
wassname
2020-10-27 06:43:50 +08:00
parent 6eda47b76f
commit 052fd6596c
9 changed files with 2920 additions and 21 deletions
+1 -1
View File
@@ -16,4 +16,4 @@ def normalize_encode_dataframe(df, encoder=OrdinalEncoder):
def timeseries_split(df, test_fraction=0.2):
"""Split timeseries data with test in the future"""
i = int(len(df)*test_fraction)
return df.iloc[:i], df.iloc[i:]
return df.iloc[:-i], df.iloc[-i:]