I have an LSTM network and I use it to predict the load. I want to get the confidence interval for the prediction. I am not sure that I can get that or not. I have tried and search in in the different platform, however, I could not find the solution. Here is my simple model.
import pandas as pd pd.options.mode.chained_assignment = None # default='warn' import numpy as np
import tensorflow as tf
from datetime import datetime
from tensorflow import keras
from keras.models import Sequential
from keras.layers import LSTM, Dense, Dropout
from keras.layers.recurrent import LSTM
from matplotlib import pyplot as plt
from sklearn.preprocessing import StandardScaler
X_train = np.random.rand(10,5,2)
Y_train = np.random.rand(10,2)
X_test = np.random.rand(3, 5, 2)
model = Sequential()
model.add(LSTM(64, activation='relu', input_shape=(X_train.shape[1], X_train.shape[2]), return_sequences=True))
model.add(LSTM(32, activation='relu', return_sequences=False))
model.add(Dropout(0.2))
model.add(Dense(Y_train.shape[1], kernel_regularizer='l2'))
opt = keras.optimizers.Adam(learning_rate=0.001)
model.compile(optimizer=opt, loss='mse')
history = model.fit(X_train, Y_train, epochs=1, batch_size=200, validation_split=0.1,verbose=1)
prediction = model.predict(X_test)