diff options
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"): |