Export runs to pandas df inside pyton

Is there a simple way to export all runs in pandas dataframe inside python script, so I can analyze all results?

1 Like

Yes, this is supported via the guild.ipy interface. Take a look at Guild AI Interactive Python Quick Start for examples in doing this.

1 Like

Works great! A workflow that I am using is to move existing runs into a $GUILD_HOME/runs/ subdirectory, and then I can access the dataframe of those with runs = guild.runs():

guild runs export 1:13 --move $GUILD_HOME/runs

The command you have there should not do anything: you’re trying to move runs to the same location. You should be seeing these warning messages:

WARNING: <run dir> exists, skipping

The environment variable GUILD_HOME has special meaning for Guild – this is where Guild stores runs and cached data. The target export directory $GUILD_HOME/runs is where Guild will read runs from so you’re effectively exporting to the same location. Guild should complain with the messages above.

Rather than move the runs, you can tell the Guild Python API where to look by setting this:

guild.set_guild_home(SOME_DIR)

By default Guild uses the directory shown for guild_home when you run guild check. You typically don’t need to change this when analyzing runs with ipy.