Created
May 15, 2022 15:08
-
-
Save h3ik0th/dc2c1a5e536d322564901540d4fbe4a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# retrieve forecast series for chosen quantiles, | |
# inverse-transform each series, | |
# insert them as columns in a new dataframe dfY | |
q50_RMSE = np.inf | |
q50_MAPE = np.inf | |
ts_q50 = None | |
pd.options.display.float_format = '{:,.2f}'.format | |
dfY = pd.DataFrame() | |
#dfY["Actual"] = TimeSeries.pd_series(ts_test) | |
# call helper function predQ, once for every quantile | |
_ = [predQ(ts_tpred, q) for q in QUANTILES] | |
# move Q50 column to the left, then insert Actual column | |
col = dfY.pop("Q50") | |
dfY.insert(0, col.name, col) | |
dfY.insert(0, "Actual", TimeSeries.pd_series(ts_test)) | |
# show first and last 13 timestamps of forecast | |
dfY.iloc[np.r_[0:1, -13:0]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment