summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/analyze-archive.py3
-rw-r--r--lib/cli.py17
2 files changed, 19 insertions, 1 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index 4aab326..1766424 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -639,6 +639,9 @@ if __name__ == "__main__":
if args.info:
dfatool.cli.print_info_by_name(model, by_name)
+ if args.export_pgf_unparam:
+ dfatool.cli.export_pgf_unparam(model, args.export_pgf_unparam)
+
if args.cross_validate:
xv_method, xv_count = args.cross_validate.split(":")
xv_count = int(xv_count)
diff --git a/lib/cli.py b/lib/cli.py
index f988421..49cb1b7 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -164,12 +164,21 @@ def export_dot(model, dot_prefix):
print(dot_model, file=f)
+def export_pgf_unparam(model, pgf_prefix):
+ for name in model.names:
+ for attribute in model.attributes(name):
+ with open(f"{pgf_prefix}{name}-{attribute}.txt", "w") as f:
+ print("measurement value", file=f)
+ for i, value in enumerate(model.attr_by_name[name][attribute].data):
+ print(f"{i} {value}", file=f)
+
+
def add_standard_arguments(parser):
parser.add_argument(
"--export-dot",
metavar="PREFIX",
type=str,
- help="Export model and model quality to LaTeX {PREFIX}{name}-{attribute}.dot",
+ help="Export tree-based model to {PREFIX}{name}-{attribute}.dot",
)
parser.add_argument(
"--export-dref",
@@ -178,6 +187,12 @@ def add_standard_arguments(parser):
help="Export model and model quality to LaTeX dataref file",
)
parser.add_argument(
+ "--export-pgf-unparam",
+ metavar="PREFIX",
+ type=str,
+ help="Export raw (parameter-independent) observations in tikz-pgf-compatible format to {PREFIX}{name}-{attribute}.txt",
+ )
+ parser.add_argument(
"--export-xv",
metavar="FILE",
type=str,