I'm new to machine learning, i'm trying to use LSTM to forecast the power production of a solar power plant, i have a small dateset that contains 7200 rows and 4 columns, i divided the data into training data (70%) and validation(30 %) and i didn't use a test set yet as i'm still experimenting, here are the configurations of my model :

generator = TimeseriesGenerator(dataset[:5065, :], dataset[:5065, :1], length=n_input, batch_size=16)
valgen = TimeseriesGenerator(dataset[5066:, :], dataset[5066:, :1], length=n_input, batch_size=16)

# define model
model = Sequential()
model.add(LSTM(500, activation='relu', input_shape=(n_input, n_features), return_sequences=True))
model.add(LSTM(200, activation='relu', return_sequences=False))
model.add(Dense(100, activation='relu', input_shape=(n_input, n_features)))
adam = Adam(lr=0.0001)

model.compile(optimizer=adam, loss='mae')

history = model.fit_generator(generator, steps_per_epoch=1, epochs=1500, verbose=1, validation_data=valgen, shuffle=False)

the results i obtained are:

Epoch 1500/1500

1/1 [==============================] - 1s 739ms/step - loss: 1.0534 - val_loss: 0.8902

I want to ask why the training loss is higher than the validation ? is it because the small validation dataset ? and if i want to include a test set , how much % of the original data it should be ? And what about the hidden layer units, am i using too much units ? how much should i use ? and should i use fewer or more layers ? Sorry for all the questions , but i need some guidance because i tried tweaking the model but i couldn't improve it yet.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.