Skip to content

Instantly share code, notes, and snippets.

@CaptainAshis
Created September 27, 2018 08:59
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/4db4373d89dd5272a42449b12384e630 to your computer and use it in GitHub Desktop.
Save CaptainAshis/4db4373d89dd5272a42449b12384e630 to your computer and use it in GitHub Desktop.
dt_feature82 ros fastai
# Step 13
for v in cat_vars: joined[v] = joined[v].astype('category').cat.as_ordered()
for v in contin_vars:
joined[v] = joined[v].fillna(0).astype('float32')
joined_test[v] = joined_test[v].fillna(0).astype('float32')
dep = 'Sales'
joined = joined[cat_vars+contin_vars+[dep, 'Date']].copy()
# We're going to run on a sample.
idxs = get_cv_idxs(n, val_pct=150000/n)
joined_samp = joined.iloc[idxs].set_index("Date")
samp_size = len(joined_samp); samp_size
# 150000
# To run on the full dataset, use this instead:
samp_size = n
joined_samp = joined.set_index("Date")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment