Skip to content

Verify/Correct Understanding of Trues/Preds in Test for Batch #3

@arkemp11

Description

@arkemp11

Good work! Thank you for sharing the code to reproduce your paper.

For batch_size=16 and seq_len=10 for preds and trues in exp_model.test and denormalizing the close price values for a stock where:

true_values = denorm_trues[15, :, 0]
pred_values = denorm_preds[15, :, 0]

For the tail batch_size in the input csv results in:

True Values: [77.65619  78.595825 79.35186  77.06217  78.23942  79.63267  79.27625
 78.97385  80.82072        nan]
Predicted Values: [78.42562  79.20458  79.50893  79.432274 79.89651  77.55834  77.40948
 77.96623  77.003975 78.728676]
Dates:[2024-02-16  2024-02-20  2024-02-21  2024-02-22 2024-02-23  2024-02-26  2024-02-27
 2024-02-28  2024-02-29 2024-03-01]

Is it correct to say that on 2024-02-16 when the stock price was 77.65619 the predicted price for 2024-03-01 is 78.728676?

Or is it that on 2024-03-01 the predicted price is 78.728676?

If not, how do I correct my understanding to get a future predicted price from trues and preds?

FYI, for this example I edited the data_loader for test to this:

        if self.set_type == 2:
            if self.seq_len == 10:
                start_idx = 760
                end_idx = 796
            elif self.seq_len == 20:
                start_idx = 740
                end_idx = 796
            elif self.seq_len == 40:
                start_idx = 700
                end_idx = 796
            elif self.seq_len == 60:
                start_idx = 660
                end_idx = 796

            border1s = [0, num_train-self.seq_len, start_idx]
            border2s = [num_train, num_train+num_vali, end_idx]
            border1 = border1s[self.set_type]
            border2 = border2s[self.set_type]

Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions