Merge remote-tracking branch 'origin/develop' into feat/freqai-rl-dev
This commit is contained in:
commit
52e15b2070
@ -358,13 +358,19 @@ 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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user