featurestorebook / mlfs-book

O'Reilly book - Building Machine Learning Systems with a feature store: batch, real-time, and LLMs
Apache License 2.0
20 stars 93 forks source link

Question about `days_before_forecast_day` #12

Open EITD opened 2 weeks ago

EITD commented 2 weeks ago

Hi, I have a question about the following two lines:

https://github.com/featurestorebook/mlfs-book/blob/d2a82921f19fdf639314ab26c8a7c5b70d1559f1/notebooks/ch03/4_air_quality_batch_inference.ipynb#L1121-L1122

Since batch_data isn’t initially sorted, applying range to populate the days_before_forecast_day column seems a bit confusing to me. In my opinion, it would make more sense if we reversed the order of these two lines.

Could you please clarify the logic behind this code?

Thank you!

rishivijayv commented 2 weeks ago

I had the same thought and was just about to post an issue here :) I do think it should be reversed as well -- otherwise, for me it seems like the forecast for 16th Nov was "1 day before forecast day" on 9th Nov