Skip to content

Commit

Permalink
save metric
Browse files Browse the repository at this point in the history
  • Loading branch information
teddygroves committed Oct 17, 2023
1 parent 0a6de64 commit faa751a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions maud/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

"""Functions that are exposed to the command line interface live here."""

import json
import os
import shutil
from datetime import datetime
Expand Down Expand Up @@ -102,6 +103,10 @@ def do_sample(data_path, output_dir):
stanfit = sample(mi, samples_path)
print(stanfit.diagnose())
print(stanfit.summary())
metric = stanfit.metric
if metric is not None:
with open(os.path.join(samples_path, "metric.json"), "w") as f:
json.dump(metric.tolist(), f)
idata = get_idata(stanfit.runset.csv_files, mi, "train")
idata.to_json(os.path.join(output_path, "idata.json"))
return output_path
Expand Down

0 comments on commit faa751a

Please sign in to comment.