Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prediction vs labels #91

Open
TayyabaZainab0807 opened this issue Jan 4, 2024 · 0 comments
Open

prediction vs labels #91

TayyabaZainab0807 opened this issue Jan 4, 2024 · 0 comments

Comments

@TayyabaZainab0807
Copy link

Upon using python train.py lstnet solar_energy --context_points 168 --target_points 24 --run_name spatiotemporal_al_solar --batch_size 25:

test/loss 0.11
test/mae. 1.82
test/mape 19922692
test/mse 12.67
test/norm_mae 0.18
test/norm_mse. 0.11
test/smape. 1.417

question1: why the mape is so big? are these results correct?
I wanted to get the predictions and manually compare them with the labels using the following code:

        forecaster.eval()
        test_dataloader = data_module.test_dataloader()
        for batch in test_dataloader:
            # Extract input features from the batch
            xc, yc, xt, yt = batch  # Assuming these are the keys in your dataset
            # Make predictions using the forecaster
            yt_pred = forecaster.predict(xc, yc, xt,yt)
            print(yt_pred)
            print(yt)
            break

This is the output:
`tensor([[[ 0.2024, 0.0527, 0.0133, ..., -0.0635, 0.0884, -0.0149],
[ 0.2010, 0.0525, 0.0131, ..., -0.0636, 0.0879, -0.0150],
[ 0.2041, 0.0523, 0.0131, ..., -0.0637, 0.0892, -0.0148],
...,
[ 0.7595, 0.0227, 0.0320, ..., -0.0812, 0.2956, 0.0085],
[ 0.8442, 0.0236, 0.0376, ..., -0.0806, 0.3280, 0.0181],
[ 0.8337, 0.0235, 0.0369, ..., -0.0809, 0.3239, 0.0163]],

    [[ 0.2031,  0.0525,  0.0132,  ..., -0.0635,  0.0887, -0.0148],
     [ 0.2030,  0.0523,  0.0131,  ..., -0.0636,  0.0887, -0.0148],
     [ 0.2059,  0.0520,  0.0130,  ..., -0.0638,  0.0898, -0.0146],
     ...,
     [ 0.8137,  0.0230,  0.0353,  ..., -0.0811,  0.3162,  0.0142],
     [ 0.8793,  0.0247,  0.0404,  ..., -0.0798,  0.3414,  0.0224],
     [ 0.8796,  0.0252,  0.0408,  ..., -0.0797,  0.3416,  0.0229]],

    [[ 0.2051,  0.0523,  0.0131,  ..., -0.0635,  0.0896, -0.0146],
     [ 0.2048,  0.0520,  0.0129,  ..., -0.0637,  0.0893, -0.0147],
     [ 0.2073,  0.0514,  0.0128,  ..., -0.0639,  0.0901, -0.0150],
     ...,
     [ 0.8487,  0.0240,  0.0380,  ..., -0.0805,  0.3296,  0.0183],
     [ 0.9288,  0.0267,  0.0446,  ..., -0.0783,  0.3606,  0.0295],
     [ 0.9326,  0.0263,  0.0444,  ..., -0.0791,  0.3620,  0.0290]],

    ...,

    [[ 0.4881,  0.0286,  0.0199,  ..., -0.0763,  0.1952, -0.0072],
     [ 0.5514,  0.0270,  0.0233,  ..., -0.0777,  0.2192, -0.0024],
     [ 0.6315,  0.0262,  0.0280,  ..., -0.0786,  0.2497,  0.0051],
     ...,
     [ 0.8561,  0.0438,  0.0564,  ..., -0.0773,  0.3446,  0.0408],
     [ 0.8403,  0.0452,  0.0564,  ..., -0.0763,  0.3386,  0.0404],
     [ 0.8614,  0.0461,  0.0588,  ..., -0.0754,  0.3468,  0.0431]],

    [[ 0.5504,  0.0270,  0.0233,  ..., -0.0778,  0.2188, -0.0025],
     [ 0.6529,  0.0259,  0.0291,  ..., -0.0788,  0.2578,  0.0069],
     [ 0.7530,  0.0256,  0.0349,  ..., -0.0795,  0.2957,  0.0162],
     ...,
     [ 0.8595,  0.0458,  0.0580,  ..., -0.0759,  0.3459,  0.0428],
     [ 0.8386,  0.0458,  0.0571,  ..., -0.0757,  0.3378,  0.0406],
     [ 0.8749,  0.0465,  0.0601,  ..., -0.0752,  0.3520,  0.0446]],

    [[ 0.6496,  0.0259,  0.0290,  ..., -0.0789,  0.2564,  0.0067],
     [ 0.7954,  0.0254,  0.0371,  ..., -0.0797,  0.3117,  0.0198],
     [ 0.8922,  0.0258,  0.0428,  ..., -0.0797,  0.3481,  0.0284],
     ...,
     [ 0.8682,  0.0466,  0.0594,  ..., -0.0751,  0.3492,  0.0442],
     [ 0.8442,  0.0460,  0.0578,  ..., -0.0757,  0.3398,  0.0411],
     [ 0.8905,  0.0470,  0.0614,  ..., -0.0748,  0.3581,  0.0463]]])

tensor([[[-0.8025, -0.7136, -0.6984, ..., -0.7011, -0.7864, -0.6945],
[-0.8025, -0.7136, -0.6984, ..., -0.7011, -0.7864, -0.6945],
[-0.8025, -0.7136, -0.6984, ..., -0.7011, -0.7864, -0.6945],
...,
[ 0.9684, 0.1093, 0.3574, ..., 0.3511, 1.0403, 0.2583],
[ 1.0116, 0.2213, 0.5154, ..., 0.5210, 1.1411, 0.4755],
[ 1.0467, 0.4340, 0.6848, ..., 0.6800, 1.2230, 0.7388]],

    [[-0.8025, -0.7136, -0.6984,  ..., -0.7011, -0.7864, -0.6945],
     [-0.8025, -0.7136, -0.6984,  ..., -0.7011, -0.7864, -0.6945],
     [-0.8025, -0.7136, -0.6984,  ..., -0.7011, -0.7864, -0.6945],
     ...,
     [ 1.0116,  0.2213,  0.5154,  ...,  0.5210,  1.1411,  0.4755],
     [ 1.0467,  0.4340,  0.6848,  ...,  0.6800,  1.2230,  0.7388],
     [ 1.0521,  0.6411,  0.8429,  ...,  0.7512,  1.2734,  0.9018]],

    [[-0.8025, -0.7136, -0.6984,  ..., -0.7011, -0.7864, -0.6945],
     [-0.8025, -0.7136, -0.6984,  ..., -0.7011, -0.7864, -0.6945],
     [-0.8025, -0.7136, -0.6984,  ..., -0.7011, -0.7864, -0.6945],
     ...,
     [ 1.0467,  0.4340,  0.6848,  ...,  0.6800,  1.2230,  0.7388],
     [ 1.0521,  0.6411,  0.8429,  ...,  0.7512,  1.2734,  0.9018],
     [ 1.0251,  0.7811,  0.9897,  ...,  0.8718,  1.3616,  1.1442]],

    ...,

    [[ 1.0116,  0.2213,  0.5154,  ...,  0.5210,  1.1411,  0.4755],
     [ 1.0467,  0.4340,  0.6848,  ...,  0.6800,  1.2230,  0.7388],
     [ 1.0521,  0.6411,  0.8429,  ...,  0.7512,  1.2734,  0.9018],
     ...,
     [ 1.2059,  1.8111,  2.0511,  ...,  1.9898,  1.2419,  2.0760],
     [ 0.7632,  1.6935,  2.0793,  ...,  2.0446,  1.2923,  2.1972],
     [ 1.0710,  1.5648,  2.1019,  ...,  2.0720,  1.3427,  2.1429]],

    [[ 1.0467,  0.4340,  0.6848,  ...,  0.6800,  1.2230,  0.7388],
     [ 1.0521,  0.6411,  0.8429,  ...,  0.7512,  1.2734,  0.9018],
     [ 1.0251,  0.7811,  0.9897,  ...,  0.8718,  1.3616,  1.1442],
     ...,
     [ 0.7632,  1.6935,  2.0793,  ...,  2.0446,  1.2923,  2.1972],
     [ 1.0710,  1.5648,  2.1019,  ...,  2.0720,  1.3427,  2.1429],
     [ 0.9198,  1.2289,  2.1414,  ...,  2.0884,  1.3112,  2.1763]],

    [[ 1.0521,  0.6411,  0.8429,  ...,  0.7512,  1.2734,  0.9018],
     [ 1.0251,  0.7811,  0.9897,  ...,  0.8718,  1.3616,  1.1442],
     [ 0.5824,  0.6019,  1.1195,  ...,  1.0417,  1.4183,  1.1358],
     ...,
     [ 1.0710,  1.5648,  2.1019,  ...,  2.0720,  1.3427,  2.1429],
     [ 0.9198,  1.2289,  2.1414,  ...,  2.0884,  1.3112,  2.1763],
     [ 1.1438,  1.1449,  2.1470,  ...,  2.0830,  1.2797,  2.2348]]])`

question2: In AL-solar, there are no negatives but the labels have some negative values? are the some scaling going on in here?
question3: even then my predictions are not at all near to the labels (I am using the provided prediction method), any idea why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant