Let me explain my problem and the dataset a bit. In my dataset, i have hourly measurements of a variable x
and 7 more columns representing the day of the week that that measurment was taken as dummy variables. So, it is something like this:
DateTime x Mon Tue Wed Thur Fri Sat Sun
2017/01/01 00:00 10 0 0 0 0 0 0 1
2017/01/01 01:00 15 0 0 0 0 0 0 1
2017/01/01 02:00 21 0 0 0 0 0 0 1
...
2017/01/01 23:00 32 0 0 0 0 0 0 1
2017/01/02 00:00 17 1 0 0 0 0 0 0
2017/01/02 01:00 19 1 0 0 0 0 0 0
2017/01/02 02:00 48 0 0 0 0 0 0 1
...
2022/08/15 00:00 43 0 0 0 0 0 0 1
This dataset has shape of (49249, 8)
.
I am using data from 2017~2021 to train, and only 2022 would be used for test.
Using two days of data (48 rows
), i need to forecast x
in the next day. After changing this dataset to look like a supervised learning, i got a new training dataset with the shape (1842, 55)
. 55
is because im using two days of data (24+24
) plus the dummy variables represnting the day i want to make a forecast (7
variables) 24+24+7 = 55
.
Now, according Keras documentation the InputShape
of a Conv1D
layer should have shape of (batch_size, steps, input_dim)
.
So i did the following:
max_batch_size = 1824
steps = 48
input_dim = 55
So, i tried to reshaped it:
dataset = dataset.reshape(max_batch_size, steps, input_dim)
And i got this error:
ValueError: cannot reshape array of size 100320 into shape (1824,48,55)
I know this have been asked a lot, but i still don't understand it and none of the answers i have seen here have worked for me. How should i set my InputLayer
to use with a Conv1D
layer?