mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-19 13:58:11 +00:00
feat(Labeling): purge overlapping events, sort dataframe at loading time (#226)
* feat(Labeling): purge overlapping events, sort dataframe at loading time * fix(Linter): ran * refactor(Labeling): moved purge_overlapping_events one abstraction level higher * fix(Data): renamed class * fix(Data): corrected parameter name * fix(Config): parameters * fix(Data): fixed path * fix(Data): uncommented required code * feat(EventFilters): use vol based CUSUM * fix(Config): only retrain every 2000 samples * fix(Config): filter out even more events * fix(Inference): added remove_overlapping_events * refactor(Types): simplified type hierarchy
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
from binance_historical_data import CandleDataDumper
|
||||
from binance_historical_data import BinanceDataDumper
|
||||
import datetime
|
||||
|
||||
data_dumper = CandleDataDumper(
|
||||
data_dumper = BinanceDataDumper(
|
||||
path_dir_where_to_dump="./data/5min_crypto/",
|
||||
str_data_frequency="5m",
|
||||
data_frequency="5m",
|
||||
)
|
||||
|
||||
assets = [
|
||||
@@ -32,7 +32,7 @@ from tqdm import tqdm
|
||||
import pandas as pd
|
||||
|
||||
for asset in tqdm(assets):
|
||||
path = f"./data/5min_crypto/{asset}/5m/monthly/"
|
||||
path = f"./data/5min_crypto/spot/monthly/klines/{asset}/5m/"
|
||||
files = os.listdir(path)
|
||||
|
||||
def load_df(path):
|
||||
@@ -56,6 +56,7 @@ for asset in tqdm(assets):
|
||||
df["timestamp"] = pd.to_datetime(df["timestamp"], unit="ms")
|
||||
df = df[["timestamp", "open", "high", "low", "close", "volume"]]
|
||||
df.set_index("timestamp", inplace=True)
|
||||
df.sort_index(inplace=True)
|
||||
return df
|
||||
|
||||
dfs = pd.concat([load_df(path + file) for file in files], axis=0)
|
||||
|
||||
Reference in New Issue
Block a user