clean up obsolete comments, move remove_features_from_df to datakitchen

This commit is contained in:
robcaulk
2022-07-22 12:17:15 +02:00
parent 0b21750e76
commit afcb0bec00
2 changed files with 18 additions and 47 deletions

View File

@@ -1116,6 +1116,16 @@ class FreqaiDataKitchen:
# self.data["lower_quantile"] = lower_q
return
def remove_features_from_df(self, dataframe: DataFrame) -> DataFrame:
"""
Remove the features from the dataframe before returning it to strategy. This keeps it
compact for Frequi purposes.
"""
to_keep = [
col for col in dataframe.columns if not col.startswith("%") or col.startswith("%%")
]
return dataframe[to_keep]
def np_encoder(self, object):
if isinstance(object, np.generic):
return object.item()