Skip to content

Instantly share code, notes, and snippets.

@CaptainAshis
Last active September 25, 2018 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CaptainAshis/11960e7423d1494e79294f234e55cb16 to your computer and use it in GitHub Desktop.
Save CaptainAshis/11960e7423d1494e79294f234e55cb16 to your computer and use it in GitHub Desktop.
ros_dt_feature2 fastai
# Step 6
# The following extracts particular date fields from a complete datetime for the purpose of constructing categoricals.
# You should *always* consider this feature extraction step when working with date-time.
# Without expanding your date-time into these additional fields, you can't capture any trend/cyclical behavior as a function of
# time at any of these granularities.
# We'll add to every table with a date field.
add_datepart(weather, "Date", drop=False)
add_datepart(googletrend, "Date", drop=False)
add_datepart(train, "Date", drop=False)
add_datepart(test, "Date", drop=False)
# Note - drop: If true then the original date column will be removed. If false it will not be dropped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment