Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
Changes made by this pull request: |
Experiment ResultsExperiment 1: air-passengersDescription:
Results:
Plot:Experiment 2: air-passengersDescription:
Results:
Plot:Experiment 3: electricity-multiple-seriesDescription:
Results:
Plot:Experiment 4: electricity-multiple-seriesDescription:
Results:
Plot:Experiment 5: electricity-multiple-seriesDescription:
Results:
Plot: |
| @@ -2,7 +2,7 @@ | |||
| "cells": [ | |||
There was a problem hiding this comment.
Line #7. start=df.iloc[0][time_col], end=df.iloc[-1][time_col], freq="D"
This assumes data is sorted which it might not be. maybe use min() and max() if the time column (assuming it is datetime format).
Also, just take the frequency as an argument and use it here. This will make the function generic so users can use it for other frequencies also. If you do this, rename the variable monthly_features to just features
Reply via ReviewNB
There was a problem hiding this comment.
Great suggestion!
There was a problem hiding this comment.
@ngupta23 I noticed that the original tutorial uses "D" for dates_range but "M" for resample, so should I keep freq="D"?
def add_date_features_to_dataframe(df, date_extractor, time_col="month", freq="M"):
# Create a copy of the dataframe
df = df.copy()
# Create date range
dates_range = pd.date_range(
start=df[time_col].min(), end=df[time_col].max(), freq="D"
)
# Get date feature indicators and resample to specified frequency
features_df = date_extractor(dates_range)
features = features_df.resample(freq).max()
features = features.reset_index(names=time_col)
# Merge with input dataframe
result_df = df.merge(features)
return result_dfThere was a problem hiding this comment.
Ah ok. I think it kept D for date range since the holidays will not be perfectly aligned with W and M freq (could occur on any day of the week/month. I guess your changes will work with resampling to freq, but keep date_range to use D.
| @@ -2,7 +2,7 @@ | |||
| "cells": [ | |||
There was a problem hiding this comment.
| @@ -2,7 +2,7 @@ | |||
| "cells": [ | |||
There was a problem hiding this comment.
Line #1. fcst_df_holidays = nixtla_client.forecast(
Change to long horizon model to remove warning?
Reply via ReviewNB
| @@ -2,7 +2,7 @@ | |||
| "cells": [ | |||
There was a problem hiding this comment.
| @@ -2,7 +2,7 @@ | |||
| "cells": [ | |||
There was a problem hiding this comment.
Line #1. nixtla_client.weights_x.plot.barh(x='features', y='weights', figsize=(10, 10))
At some point we had discussed to streamline this and not use the weights_x attribute, instead standardizing on the use of shap which is also what is shown in the interpretibility tutorial. Can you check with @marcopeix and @elephaint if we want to continue to show this?
Reply via ReviewNB
| @@ -2,7 +2,7 @@ | |||
| "cells": [ | |||
There was a problem hiding this comment.
| @@ -2,7 +2,7 @@ | |||
| "cells": [ | |||
There was a problem hiding this comment.
Line #4. freq="M",
Same comments as above - change to ME and maybe use the long-horizon model?
Reply via ReviewNB
| @@ -2,7 +2,7 @@ | |||
| "cells": [ | |||
There was a problem hiding this comment.
Line #1. nixtla_client.weights_x.plot.barh(x="features", y="weights", figsize=(10, 6))
Same comment as above - maybe use Shap?
Reply via ReviewNB





No description provided.