MCPcopy Create free account
hub / github.com/chaoshangcs/GTS / static_predict

Function static_predict

scripts/eval_baseline_methods.py:39–50  ·  view source on GitHub ↗

Assumes $x^{t+1} = x^{t}$ :param df: :param n_forward: :param test_ratio: :return:

(df, n_forward, test_ratio=0.2)

Source from the content-addressed store, hash-verified

37
38
39def static_predict(df, n_forward, test_ratio=0.2):
40 """
41 Assumes $x^{t+1} = x^{t}$
42 :param df:
43 :param n_forward:
44 :param test_ratio:
45 :return:
46 """
47 test_num = int(round(df.shape[0] * test_ratio))
48 y_test = df[-test_num:]
49 y_predict = df.shift(n_forward).iloc[-test_num:]
50 return y_predict, y_test
51
52
53def var_predict(df, n_forwards=(1, 3), n_lags=4, test_ratio=0.2):

Callers 1

eval_staticFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected