Created
September 27, 2018 06:22
-
-
Save CaptainAshis/392a6c9e7f2112a00bf77005572cf242 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step 13 | |
df, y, nas, mapper = proc_df(joined_samp, 'Sales', do_scale=True) | |
yl = np.log(y) | |
joined_test = joined_test.set_index("Date") | |
df_test, _, nas, mapper = proc_df(joined_test, 'Sales', do_scale=True, skip_flds=['Id'], | |
mapper=mapper, na_dict=nas) | |
df.head(2) | |
# 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))) | |
val_idx = np.flatnonzero( | |
(df.index<=datetime.datetime(2014,9,17)) & (df.index>=datetime.datetime(2014,8,1))) | |
val_idx=[0] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment