diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-02-24 15:53:23 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-02-24 15:53:23 +0100 |
commit | 52a0aaaca1427d5f3b35625f681dc44e01f4d8db (patch) | |
tree | e7b1995a5f18ce033b8a593c1a9442f4157e4b88 /lib | |
parent | 5a7a03543379507f29d5af03110d94915a322b1c (diff) |
add --export-xv option for t-tests and the like
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cli.py | 6 | ||||
-rw-r--r-- | lib/validation.py | 7 |
2 files changed, 13 insertions, 0 deletions
@@ -178,6 +178,12 @@ def add_standard_arguments(parser): help="Export model and model quality to LaTeX dataref file", ) parser.add_argument( + "--export-xv", + metavar="FILE", + type=str, + help="Export raw cross-validation results to FILE for later analysis (e.g. to compare different modeling approaches by means of a t-test)", + ) + parser.add_argument( "--info", action="store_true", help="Show benchmark information (number of measurements, parameter values, ...)", diff --git a/lib/validation.py b/lib/validation.py index 89bc67c..6e8fa17 100644 --- a/lib/validation.py +++ b/lib/validation.py @@ -103,6 +103,7 @@ class CrossValidator: self.names = sorted(by_name.keys()) self.parameters = sorted(parameters) self.parameter_aware = False + self.export_filename = None self.args = args self.kwargs = kwargs @@ -233,6 +234,12 @@ class CrossValidator: res[name][attribute][measure] ) + if self.export_filename: + import json + + with open(self.export_filename, "w") as f: + json.dump(ret, f) + for name in self.names: for attribute in self.by_name[name]["attributes"]: for measure in ("mae", "rmsd", "mape", "smape"): |