kats/models/globalmodel/ensemble.py [479:498]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        fcst_window = self.params.fcst_window
        ans = []
        keys = (
            test_train_TSs.keys()
            if isinstance(test_train_TSs, dict)
            else range(len(test_train_TSs))
        )
        for k in keys:
            tmp = test_valid_TSs[k].value.values
            tmp_step = len(tmp) // fcst_window + int(len(tmp) % fcst_window != 0)
            tmp_fcst_length = tmp_step * fcst_window
            actuals = np.full(tmp_fcst_length, np.nan, np.float)
            actuals[: len(tmp)] = tmp
            for j in range(tmp_step):
                tmp_actuals = actuals[j * fcst_window : (j + 1) * fcst_window]
                tmp = eval_func(fcst[k][j], tmp_actuals)
                tmp["step"] = j
                tmp["idx"] = k
                ans.append(tmp)
        return pd.DataFrame(ans)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



kats/models/globalmodel/model.py [891:910]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        fcst_window = self.params.fcst_window
        ans = []
        keys = (
            test_train_TSs.keys()
            if isinstance(test_train_TSs, dict)
            else range(len(test_train_TSs))
        )
        for k in keys:
            tmp = test_valid_TSs[k].value.values
            tmp_step = len(tmp) // fcst_window + int(len(tmp) % fcst_window != 0)
            tmp_fcst_length = tmp_step * fcst_window
            actuals = np.full(tmp_fcst_length, np.nan, np.float)
            actuals[: len(tmp)] = tmp
            for j in range(tmp_step):
                tmp_actuals = actuals[j * fcst_window : (j + 1) * fcst_window]
                tmp = eval_func(fcst[k][j], tmp_actuals)
                tmp["step"] = j
                tmp["idx"] = k
                ans.append(tmp)
        return pd.DataFrame(ans)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



