Multiple data series plot

Hey,
I’m trying to plot multiple lines in the same plot using example showed here:

plots:
  - test_vs_train_loss:
      x: epoch
      y:
        training_data.csv: [test_loss, train_loss]
      title: Compare loss training versus test

expected str, in stages → train_model → plots → 0 → test_vs_train_loss → y, line 56, column 13
55 │ │ y:
56 │ │ │ training_data.csv: [test_loss, train_loss]

The example doesn’t seem to work. Array object seems not be supported? What am I missing?

Hey @Dano!
What is your dvc version?

I think plots should be a dictionary:

plots:
  test_vs_train_loss:
    x: epoch
    y:
      training_data.csv: [test_loss, train_loss]
    title: Compare loss training versus test

2 Likes

Im using 2.17.0
I also tried the dictionary version but I get ‘expected list’ error

@Dano

could you try running this script?

#!/bin/bash

set -exu
pushd $TMPDIR

wsp=test_wspace
rep=test_repo

rm -rf $wsp && mkdir $wsp && pushd $wsp
main=$(pwd)

mkdir $rep && pushd $rep

git init
dvc init

echo -e "epoch,test_loss,train_loss
0,1,5
1,2,6
2,3,7" > data

dvc add data
dvc run -d data -o training_data.csv -n train cp data training_data.csv

echo -e "plots:
  test_vs_train_loss:
    x: epoch
    y:
      training_data.csv: [test_loss, train_loss]
    title: Compare loss training versus test
" >> dvc.yaml


dvc plots show --open

It will work on Unix system.