I have a dataset which describes water level of river,looks like this:
And then I process data like this:
res_df = pd.read_csv(my_table)
t = res_df['TM']
y = res_df['Z']
t_train, t_test, y_train, y_test = train_test_split(t, y, test_size=0.25)
# set size of input/output windows
iw = 72
ow = 72
s = 12
# generate windowed training/test datasets
Xtrain, Ytrain = generate_dataset.windowed_dataset(y_train.to_numpy().reshape(-1, 1),
input_window=iw, output_window=ow, stride=s)
Xtest, Ytest = generate_dataset.windowed_dataset(y_test.to_numpy().reshape(-1, 1),
input_window=iw, output_window=ow, stride=s)
X_train, Y_train, X_test, Y_test = generate_dataset.numpy_to_torch(Xtrain, Ytrain, Xtest, Ytest)
You can see I want to predict 72 water levels in 72 hours from last 72 hours, and dim of X_train/Y_train is (72, 1259, 1), X_test/Y_test is (72, 412, 1) .
Then I use these codes to test the model:
You can see almost all R² of 412 slices is smaller than 0, so it's a bad model.
I have adjusted parameters of LSTM for serveral times, but I don't get a ideal result. Do I have any mistake? If you are here, please answer me.
I have a dataset which describes water level of river,looks like this:
And then I process data like this:
You can see I want to predict 72 water levels in 72 hours from last 72 hours, and dim of X_train/Y_train is
(72, 1259, 1)
, X_test/Y_test is(72, 412, 1)
. Then I use these codes to test the model:However 412 outputs of slices look like this:
You can see almost all R² of 412 slices is smaller than 0, so it's a bad model. I have adjusted parameters of LSTM for serveral times, but I don't get a ideal result. Do I have any mistake? If you are here, please answer me.