From dfa508d0bddabd3e64ad86693b2c25537613bed8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 1 Dec 2021 14:25:51 +0100 Subject: move some standard arguments to cli helper class --- lib/cli.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'lib/cli.py') diff --git a/lib/cli.py b/lib/cli.py index bb1b111..a1e4a58 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -1,10 +1,6 @@ #!/usr/bin/env python3 -from dfatool.functions import ( - SplitFunction, - AnalyticFunction, - StaticFunction, -) +from dfatool.functions import SplitFunction, AnalyticFunction, StaticFunction def print_static(model, static_model, name, attribute): @@ -98,3 +94,24 @@ def model_quality_table(header, result_lists, info_list): else: buf += "{:7}----{:8}".format("", "") print(buf) + + +def add_standard_arguments(parser): + parser.add_argument( + "--export-dref", + metavar="FILE", + type=str, + help="Export model and model quality to LaTeX dataref file", + ) + parser.add_argument( + "--cross-validate", + metavar=":", + type=str, + help="Perform cross validation when computing model quality. " + "Only works with --show-quality=table at the moment.", + ) + parser.add_argument( + "--parameter-aware-cross-validation", + action="store_true", + help="Perform parameter-aware cross-validation: ensure that parameter values (and not just observations) are mutually exclusive between training and validation sets.", + ) -- cgit v1.2.3