Skip to content

Commit 4a25ffd

Browse files
committed
Update ffill and bfill
1 parent 0799370 commit 4a25ffd

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

RCAEval/classes/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def preprocess(
101101
data_frame[0] = pd.to_datetime(data_frame[0], unit=kwargs.get("unit", "s"), utc=True)
102102
data_frame: pd.DataFrame = data_frame.set_index(0).resample(interval, origin="start").mean()
103103
data_frame.interpolate(method="time", limit_direction="both", inplace=True)
104-
data_frame.fillna(method="bfill", inplace=True)
104+
data_frame.bfill(inplace=True)
105105

106106
# 3. Return values only
107107
data_frame.sort_index(inplace=True)

RCAEval/e2e/baro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def mmnsigma(data, inject_time=None, dataset=None, num_loop=None, sli=None, anom
9191

9292
# == traces_err ==
9393
if dataset == "mm-tt" or dataset == "mm-ob":
94-
traces_err = traces_err.fillna(method='ffill')
94+
traces_err = traces_err.ffill()
9595
traces_err = traces_err.fillna(0)
9696
traces_err = drop_constant(traces_err)
9797

@@ -100,7 +100,7 @@ def mmnsigma(data, inject_time=None, dataset=None, num_loop=None, sli=None, anom
100100

101101
# == traces_lat ==
102102
if dataset == "mm-tt" or dataset == "mm-ob":
103-
traces_lat = traces_lat.fillna(method='ffill')
103+
traces_lat = traces_lat.ffill()
104104
traces_lat = traces_lat.fillna(0)
105105
traces_lat = drop_constant(traces_lat)
106106
normal_traces_lat = traces_lat[traces_lat["time"] < inject_time].drop(columns=["time"])

RCAEval/e2e/mscred.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def mscred(data, inject_time=None, dataset=None, num_loop=None, sli=None, anomal
577577
inject_time = int(f.readlines()[0].strip())
578578
data = data.loc[:, ~data.columns.str.endswith("_latency-50")]
579579
data = data.replace([np.inf, -np.inf], np.nan)
580-
data = data.fillna(method="ffill")
580+
data = data.ffill()
581581
data = data.fillna(0)
582582

583583
# select only n time series

RCAEval/graph_construction/cmlp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ def cmlp(data: pd.DataFrame, max_iter=None):
594594

595595
node_names = data.columns.to_list()
596596
# fill nan by ffill
597-
data = data.fillna(method="ffill")
597+
data = data.ffill()
598598
data = data.to_numpy().astype(float)
599599
device = torch.device("cpu")
600600

RCAEval/graph_construction/fci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def fci_default(data: pd.DataFrame):
66
node_names = data.columns.to_list()
77

88
# fill nan by ffill
9-
data = data.fillna(method="ffill")
9+
data = data.ffill()
1010

1111
data = data.to_numpy().astype(float)
1212

legacy/eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def process(data_path):
292292
data = data.replace([np.inf, -np.inf], np.nan)
293293

294294
# handle na
295-
data = data.fillna(method="ffill")
295+
data = data.ffill()
296296
data = data.fillna(0)
297297

298298
# check if there is any nan or inf

legacy/graph_eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def process(data_path):
362362

363363
# == PROCESS ==
364364
# func = globals()[args.model]
365-
data = data.fillna(method="ffill")
365+
data = data.ffill()
366366
data = data.fillna(value=0)
367367
np_data = np.absolute(data.to_numpy().astype(float))
368368

legacy/rq1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def process(data_path):
220220

221221

222222
# == PROCESS ==
223-
data = data.fillna(method="ffill")
223+
data = data.ffill()
224224
data = data.fillna(value=0)
225225
np_data = np.absolute(data.to_numpy().astype(float))
226226

main-ase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def process(data_path):
198198
data = data.replace([np.inf, -np.inf], np.nan)
199199

200200
# handle na
201-
data = data.fillna(method="ffill")
201+
data = data.ffill()
202202
data = data.fillna(0)
203203

204204
cut_length = 0

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def process(data_path):
197197
data = data.replace([np.inf, -np.inf], np.nan)
198198

199199
# handle na
200-
data = data.fillna(method="ffill")
200+
data = data.ffill()
201201
data = data.fillna(0)
202202

203203
with open(join(data_dir, "inject_time.txt")) as f:

0 commit comments

Comments
 (0)