Skip to content

Instantly share code, notes, and snippets.

@CaptainAshis
Last active September 27, 2018 10:44
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/952ed5e2823eee36871407d688d4414a to your computer and use it in GitHub Desktop.
Save CaptainAshis/952ed5e2823eee36871407d688d4414a to your computer and use it in GitHub Desktop.
dt_feature92 ros fastai
# Approach 1
# One approach is to take the last 25% of rows (sorted by date) as our validation set.
train_ratio = 0.75
# train_ratio = 0.9
train_size = int(samp_size * train_ratio); train_size
val_idx = list(range(train_size, len(df)))
# Approach 2:- Just the last 2 weeks of data
val_idx = np.flatnonzero(
(df.index<=datetime.datetime(2014,9,17)) & (df.index>=datetime.datetime(2014,8,1)))
val_idx=[0]
# We will go with Approach 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment