machine learning - Wrong predictions with LSTM Neural Network -


i new lstm , trying train model predict traffic flow of ip given year of data. dataset provided kaggle https://www.kaggle.com/crawford/computer-network-traffic.

this how network modeled

model = sequential() model.add(lstm(128,input_shape=(trainx.shape[1], trainx.shape[2]),                activation='relu',return_sequences=true)) model.add(lstm(32, return_sequences=true)) model.add(lstm(10)) model.add(dense(1)) model.compile(loss='mean_squared_error', optimizer='adam') model.fit(trainx, trainy, epochs=10, batch_size=64, verbose=2) 

you can find details in kernel https://www.kaggle.com/asindico/computer-network-traffic-eda/

this after 10 epochs

enter image description here

in blu actual values, in red predictions.

unfortunately, there no universal solution issue, it's clear model underfitts data.

what can suggest?

  • reduce number of hidden layers in model,

  • increase number of epochs,

  • change/try optimizer function "sgd" or "rmsprop",

  • increase batch size,

  • and add regularization , dropout.

as said, there no universal solution, so, try above , might you.

also, check activation function output layer. + suggested normalize input data.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -