# Why Shuffle Sequential Data

**URL:** <https://community.deeplearning.ai/t/why-shuffle-sequential-data/158025>\
**Category:** Sequences, Time Series and Prediction\
**Tags:** week-module-2\
**Created:** [July 8, 2022, 10:24pm UTC](https://community.deeplearning.ai/t/why-shuffle-sequential-data/158025 "2022-07-08T22:24:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LiviaPimentel](https://avatars.discourse-cdn.com/v4/letter/l/bbe5ce/32.png) [@LiviaPimentel](https://community.deeplearning.ai/u/LiviaPimentel)\
**Post date:** [July 8, 2022, 10:24pm UTC](https://community.deeplearning.ai/t/why-shuffle-sequential-data/158025/1 "2022-07-08T22:24:25Z")

</div>

Hi, everyone.

I have recently started working with time series data. This course is being very helpful in this learning journey.

I have a question related to this week class:

In this week, it is introduced the ‘shuffle buffer’ parameter, which helps us shuffle our time series data. I inderstand that it is necessary to avoid sequence bias, but I’ve also read that, in time series cross validation, for instantce, it is not recommended to use the parameter shuffle=True (otherwise, we would fail to “teach” the model that there is a temporal sequence of information).

Could someone explain why the “shuffle buffer” doesn’t harm training, whereas shuffle = True in cv does?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 9, 2022, 7:51am UTC](https://community.deeplearning.ai/t/why-shuffle-sequential-data/158025/2 "2022-07-09T07:51:50Z")

</div>

Rows are shuffled only after creating input to output mappings when it comes to time series data. As a result, data within a single row will be in increasing order of time. So, no damage is done to validity of data.

---

<div class="post-metadata">

**Author:** ![LiviaPimentel](https://avatars.discourse-cdn.com/v4/letter/l/bbe5ce/32.png) [@LiviaPimentel](https://community.deeplearning.ai/u/LiviaPimentel)\
**Post date:** [July 9, 2022, 5:28pm UTC](https://community.deeplearning.ai/t/why-shuffle-sequential-data/158025/3 "2022-07-09T17:28:36Z")

</div>

Thank you for your reply, @balaji.ambresh . I understand now!

---

<div class="post-metadata">

**Author:** ![John\_Hill\_Escobar](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/john_hill_escobar/32/140142_2.png) [@John\_Hill\_Escobar](https://community.deeplearning.ai/u/John_Hill_Escobar)\
**Post date:** [November 9, 2023, 1:39pm UTC](https://community.deeplearning.ai/t/why-shuffle-sequential-data/158025/4 "2023-11-09T13:39:47Z")

</div>

Balaji can you elaborate more on this? I don’t see why the autocorrelation principle is NOT violated by shuffling data.

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [November 9, 2023, 3:14pm UTC](https://community.deeplearning.ai/t/why-shuffle-sequential-data/158025/5 "2023-11-09T15:14:29Z")

</div>

We are not shuffling the order of data points within a single row of input. I don’t see why auto correlation should be of concern.
