Dec 21, 2022
Hi Vitor!
Thanks for the comment! I'm glad you enjoyed the article!
That's a really good question and it could be a case of data leakage if the rolling function considered the power consumption of the 30th of December in the calculation of the mean.
In this case, we can and we need to use the real power consumption data because in a real case scenario, we'd have that data available in our dataset. If hyphotetically we wanted to calculate tomorrow's power consumption, the algorithm would be able to feed on the previous 15 days SMA. Does it make sense?