Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://github.com/PaddlePaddle/PaddleTS/blob/18accdedae896405a4d245b084655fbb1fdfd10a/paddlets/models/data_adapter.py#L961 #487

Closed
kachadx opened this issue Apr 15, 2024 · 4 comments
Assignees

Comments

@kachadx
Copy link

kachadx commented Apr 15, 2024

data_adapter的_validate_known_cov_timeseries方法RangeIndex是不是逻辑上面有问题
else:
# RangeIndex
# Note: RangeIndex.stop is right-opened, but time_window is right-closed, so stop param must + 1.
step = self._std_timeindex.step
exceeded_timeindex = pd.RangeIndex(
start=self._std_timeindex[-1],
stop=(self._time_window[1] + 1) * step,
step=step
)
sample_end_std_time = exceeded_timeindex[-1]
start=self._std_timeindex[-1]的取值为什么取的是RangeIndex的stop值,导致exceeded_timeindexs的size为0,sample_end_std_time = exceeded_timeindex[-1]这行代码报IndexError: index -1 is out of bounds for axis 0 with size 0

@kachadx
Copy link
Author

kachadx commented Apr 15, 2024

stop=(self._time_window[1] + 1) * step,看了下这个self._time_window的取值逻辑,知道问题在哪里了,start取的是RangeIndex的stop值(self._std_timeindex[-1]),self._time_window的取值是(len(tsdataset.get_target().data) - 1 + self._skip_chunk_len
+ self._out_chunk_len),如果我的测试数据集的索引值不是从0开始的自增的话,会导致start>stop

@kachadx
Copy link
Author

kachadx commented Apr 16, 2024

        raise_if_not(
            known_cov_ts.start_time <= sample_start_std_time <=
            sample_end_std_time <= known_cov_ts.end_time,
            f"The inequality must hold: " +
            f"TSDataset.known_cov.start_time ({known_cov_ts.start_time}) <= "
            + f"TSDataset.{self._std_timeseries_name}.time_index" +
            f"[(time_window[0] - out_chunk_len - skip_chunk_len - in_chunk_len + 1)] "
            + f"({sample_start_std_time}) <= " +
            f"TSDataset.{self._std_timeseries_name}.time_index[time_window[1]] "
            + f"({sample_end_std_time}) <= " +
            f"TSDataset.known_cov.end_time ({known_cov_ts.end_time}).")

这里known_cov.end_time要大于sample_end_std_time?那是意思known_cov的索引值是要大于预测时间索引值吗?

@Sunting78
Copy link
Collaborator

您好,因为known_cov是未来已知协助变量,所以是要大于历史的结束时最后一个时间节点。

@Sunting78
Copy link
Collaborator

您好,由于问题超过一周,将自动关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants