K-fold cross validation in one run?

Hello,
I have set a run with a model to execute k-fold cross validation. When the axis of the AUC or loss plot is steps , all the folds are shown but when I select the axis to be equal to epochs, then only one run is shown. Which is this run? The last one, the average of all the runs or the best one?


Thanks in advance.

Because it did not let me post two images, I am posting here the initial graoh with all the folds.

Hey @soulios!

So from your description of the issue, looks like the epochs are being overwritten as the folds progress, leading to this issue. Here are 2 solutions that would work here:

  1. Consider each fold as an individual run. You can use the group parameter to consolidate all your folds into individual experiments.
  2. Log a different key for each fold as:
wandb.log({
  "Metric" : metric
  f"Fold {fold} Epoch" : epoch
})

or

wandb.log({
  f"Fold {fold} Metric" : metric
  f"Fold {fold} Epoch" : epoch
})
2 Likes

Hey @ramit_goolry ! Thans for the reply. So the first plot refers to the last fold essentially?

Yup, that’s correct.

1 Like

Hi there, I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved.

1 Like

Hi @soulios, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.