docs: Add time series analysis notebook#2328
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
bigframes/ml/forecasting.py
Outdated
| # Auto-convert Date to datetime for hourly/per_minute frequency | ||
| if self.data_frequency in ["hourly", "per_minute"]: | ||
| timestamp_col = X.columns[0] | ||
| if "date" in X[timestamp_col].dtype.name: |
There was a problem hiding this comment.
Non-rhetorical question: What if the the column has dtype "datetime"? Is it necessary that we still cast that column as datetime, and warn that the column has "date" type?
There was a problem hiding this comment.
The error would not exist if column has a dtype "datetime". In this case, no cast/warning will exist.
There was a problem hiding this comment.
Hmmm, in that case the expression
"date" in X[timestamp_col].dtype.name
would still evaluate to True, right? Is that something we want?
There was a problem hiding this comment.
Thanks for suggestion. I believe Garrett has a fair point. Thus I revert the code change. Now this PR only include the notebook changes.
bigframes/ml/forecasting.py
Outdated
| timestamp_col = X.columns[0] | ||
| if "date" in X[timestamp_col].dtype.name: | ||
| warnings.warn( | ||
| f"Converting Date column '{timestamp_col}' to datetime for " |
There was a problem hiding this comment.
It seems not make sense to convert and predict with hourly and minute data frequency to date granularity. We should just let it emit errors.
There was a problem hiding this comment.
It is a fair point. I revert the code change and update notebook
3124cd3 to
b1215ca
Compare
Adds a new notebook, timeseries_analysis.ipynb, to provide a comprehensive walkthrough of time series forecasting with TimesFM and ARIMAPlus. The notebook covers data loading, preprocessing, model training, and visualization of results for both single and multiple time series.
Fixes #<466169940> 🦕