0
$\begingroup$

I am trying to predict 4 values concurrently for next 24 hours

n_lookback = 48  
n_forecast = 24 

I am breaking the sequences like this:

for i in range(n_lookback, len(y) - n_forecast + 1):

    X.append(y[i - n_lookback: i, 0:df[cols].shape[1]])
    Y.append(y[i: i + n_forecast, 0:df[cols].shape[1]])

Below is the architecture of my model

X = np.array(X)
Y = np.array(Y)


X = X.reshape(X.shape[0], 1, n_lookback, 4)
# fit the model
model = Sequential()

model.add(TimeDistributed(Conv1D(64, kernel_size=3, activation='relu', input_shape= (None, n_lookback, 4))))
model.add(TimeDistributed(MaxPooling1D(2)))
model.add(TimeDistributed(Conv1D(128, kernel_size=3, activation='relu')))
model.add(TimeDistributed(MaxPooling1D(2)))
model.add(TimeDistributed(Conv1D(64, kernel_size=3, activation='relu')))
model.add(TimeDistributed(MaxPooling1D(2)))
model.add(Flatten())

# LSTM layers
model.add(RepeatVector(n_forecast))

model.add(Bidirectional(LSTM(100, return_sequences=True)))
model.add(Dropout(0.7))
model.add(Bidirectional(LSTM(100, return_sequences=True)))
model.add(Dropout(0.7))
model.add(TimeDistributed(Dense(100, activation='relu')))
model.add(TimeDistributed(Dense(4)))

But it not learning peak. It just overshoots above peak.

enter image description here

Orange line is prediction line

It performs exceptionally well, when I did it in univariate prediction but performs poor in multivariate prediction.

Kindly help me in this regard.

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.