[Python] Low train/test loss, but bad prediction

Discussão em 'Python' iniciado por Stack, Fevereiro 3, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to estimate 2 values for impedance at different frequencies. My inputs are 3 variables (720 sets) + frequency (89 different values) ~64K dataset and the output is the two impedance values at each frequency for each of the 720 sets. I've split this data into a training/test set of 80/20, and I've kept 2 samples out of the data set that i use for completely unbiased estimations.

    My training/test loss is fairly/very low or even =0 (depending on number of epochs) and when estimating an impedance of variables included in the dataset i can get a perfect fit (of course) but when predicting from the samples held out from the data set it is not as good.

    The train and test loss also seem to follow each other a bit too much/lay right on top of each other and i cant seem to induce a rise in test loss (overfitting) by just increasing the training time. So that seems like a problem?

    Im using pytorch, which is the first time (and I am in general fairly new to ML), and cant seem to find out what is wrong, so any help/advice would be greatly appreciated. I've made a repo, if you want to look through my messy code.

    I've tried optimizing hyperparameters, and lowering train/test loss, but this still doesnt make my predictions better.

    Continue reading...

Compartilhe esta Página