コード例 #1
0
ファイル: _split.py プロジェクト: magittan/sktime
    def _split_windows(self, y):
        window_length = check_window_length(self.window_length)
        fh = check_fh(self.fh)
        check_fh_is_relative(fh)

        end = self._get_end(y) - 1
        start = 0 if window_length is None else end - window_length
        training_window = np.arange(start, end)
        test_window = end + fh - 1
        yield training_window, test_window
コード例 #2
0
ファイル: _split.py プロジェクト: magittan/sktime
    def _split_windows(self, y):
        step_length = check_step_length(self.step_length)
        window_length = check_window_length(self.window_length)
        fh = check_fh(self.fh)
        check_fh_is_relative(fh)

        end = self._get_end(y)
        start = self._get_start()
        for split_point in range(start, end, step_length):
            training_window = np.arange(split_point - window_length,
                                        split_point)
            test_window = split_point + fh - 1
            yield training_window, test_window
コード例 #3
0
ファイル: _split.py プロジェクト: magittan/sktime
    def _split_windows(self, y):
        # cutoffs
        cutoffs = check_cutoffs(self.cutoffs)
        if not np.max(cutoffs) < len(y):
            raise ValueError("`cutoffs` are out-of-bounds for given `y`.")

        fh = check_fh(self.fh)
        check_fh_is_relative(fh)

        if np.max(cutoffs) + np.max(fh) > len(y):
            raise ValueError(
                "`fh` is out-of-bounds for given `cutoffs` and `y`.")
        window_length = check_window_length(self.window_length)

        for cutoff in cutoffs:
            training_window = np.arange(cutoff - window_length, cutoff) + 1
            test_window = cutoff + fh
            yield training_window, test_window