Rossmann with own data - output is all 1s


(Jason McConochie) #1

Trying to apply Rossman time series with own data. Cannot get prediction to produce sensible numbers. Most the inputs are described below. The outputs are all ones (1.).

Inputs to model below:
df

Date Tp WindSpd WindDir
2018-01-01 00:10:00 -0.012161 -0.513411 0.994103
2018-01-01 00:20:00 0.431020 -0.513411 0.946183
2018-01-01 00:30:00 0.874201 -0.333679 0.910244
2018-01-01 00:40:00 0.710355 -0.513411 0.814404
2018-01-01 00:50:00 0.546477 -0.693146 0.922223
df_test
Tp WindSpd WindDir
Date
2018-04-15 10:40:00 -0.388002 -0.693146 -0.527347
2018-04-15 11:20:00 -0.496661 -0.872878 -0.455467
2018-04-15 11:30:00 -0.455371 -0.693146 -0.527347
2018-04-15 11:40:00 -0.455371 -0.872878 -0.407548
2018-04-15 11:50:00 -0.455371 -0.872878 -0.635166
y
array([[-0.41375],
[-0.39883],
[-0.39485],
[-0.38633],
[-0.37788],
[-0.3695 ],
[-0.39978],
[-0.431 ],
[-0.46323],
[-0.42849],
[-0.39491],
[-0.36242],
[-0.33436],
[-0.30707],
[-0.2805 ],
[-0.28884],…
[ 0.06911]], dtype=float32)

print(samp_size)
print(train_size)
19295
14471

display(y_range)
(0, 1.9120629787445067)

md = ColumnarModelData.from_data_frame(PATH, val_idx, df, yl.astype(np.float32), cat_flds=cat_vars, bs=128,test_df=df_test)

nContVar = len(df.columns)-len(cat_vars)
m = md.get_learner(emb_szs, nContVar,
0.04, 1, [1000,500], [0.001,0.01], y_range=y_range)

100% 1/1 [00:00<00:00, 2.50it/s]
epoch trn_loss val_loss
0 0.233653 0.237296

m.fit(lr, 3, metrics=[exp_rmspe])
Epoch
100% 3/3 [00:01<00:00, 2.57it/s]
epoch trn_loss val_loss exp_rmspe
0 0.255304 0.237296 0.363319
1 0.250244 0.237296 0.363319
2 0.260968 0.237296 0.363319

[array([0.2373]), 0.3633193308459005]

x,y=m.predict_with_targs()
exp_rmspe(x,y)
pred_test=m.predict(True)
pred_test = np.exp(pred_test)
display(pred_test)

array([[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],

[1.]], dtype=float32)