Merge remote-tracking branch 'origin/develop' into feat/freqai-rl-dev

This commit is contained in:
robcaulk 2022-10-30 10:16:39 +01:00
commit 52e15b2070

View File

@ -358,12 +358,18 @@ class FreqaiDataKitchen:
:param df: Dataframe to be standardized :param df: Dataframe to be standardized
""" """
for item in df.keys(): train_max = [None] * len(df.keys())
df[item] = ( train_min = [None] * len(df.keys())
2
* (df[item] - self.data[f"{item}_min"]) for i, item in enumerate(df.keys()):
/ (self.data[f"{item}_max"] - self.data[f"{item}_min"]) train_max[i] = self.data[f"{item}_max"]
- 1 train_min[i] = self.data[f"{item}_min"]
train_max_series = pd.Series(train_max, index=df.keys())
train_min_series = pd.Series(train_min, index=df.keys())
df = (
2 * (df - train_min_series) / (train_max_series - train_min_series) - 1
) )
return df return df