diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2023-12-14 14:33:00 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2023-12-14 14:33:00 +0100 |
commit | ddd575bad607fb1483555001ae04fb8d41d229cd (patch) | |
tree | f43dbd4ba10b2029d57b3b3486bf1461cacf0f41 | |
parent | 71a950990e6654022317264277754d25cb830d9f (diff) |
analyze-log: add --boxplot-param option
-rwxr-xr-x | bin/analyze-log.py | 33 | ||||
-rw-r--r-- | lib/cli.py | 6 |
2 files changed, 39 insertions, 0 deletions
diff --git a/bin/analyze-log.py b/bin/analyze-log.py index 0ea7921..23d3e46 100755 --- a/bin/analyze-log.py +++ b/bin/analyze-log.py @@ -174,6 +174,39 @@ def main(): show=not args.non_interactive, ) + if args.boxplot_param: + title_suffix = None + if args.filter_param: + title_suffix = "filter: " + ", ".join( + map(lambda kv: f"{kv[0]}={kv[1]}", args.filter_param) + ) + by_param = model.get_by_param() + for name in model.names: + attr_names = sorted(model.attributes(name)) + param_keys = list( + map(lambda kv: kv[1], filter(lambda kv: kv[0] == name, by_param.keys())) + ) + param_desc = list( + map( + lambda param_key: ", ".join( + map( + lambda ip: f"{model.param_name(ip[0])}={ip[1]}", + enumerate(param_key), + ) + ), + param_keys, + ) + ) + for attribute in attr_names: + dfatool.plotter.boxplot( + param_desc, + list(map(lambda k: by_param[(name, k)][attribute], param_keys)), + output=f"{args.boxplot_param}{name}-{attribute}.pdf", + title_suffix=title_suffix, + ylabel=attribute, + show=not args.non_interactive, + ) + if args.cross_validate: xv_method, xv_count = args.cross_validate.split(":") xv_count = int(xv_count) @@ -264,6 +264,12 @@ def add_standard_arguments(parser): help="Export boxplots of raw (parameter-independent) observations to {PREFIX}{name}-{attribute}.pdf", ) parser.add_argument( + "--boxplot-param", + metavar="PREFIX", + type=str, + help="Export boxplots of observations to {PREFIX}{name}-{attribute}.pdf, with one boxplot per parameter combination", + ) + parser.add_argument( "--export-xv", metavar="FILE", type=str, |