summaryrefslogtreecommitdiff
path: root/lib/cli.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-12-01 14:25:51 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2021-12-01 14:25:51 +0100
commitdfa508d0bddabd3e64ad86693b2c25537613bed8 (patch)
tree79c8a859e7d98c699627112b9a5f3f13dcf218c2 /lib/cli.py
parent7e07dfbe880e380b95586ce9eb32bf80f14736c1 (diff)
move some standard arguments to cli helper class
Diffstat (limited to 'lib/cli.py')
-rw-r--r--lib/cli.py27
1 files changed, 22 insertions, 5 deletions
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="<method>:<count>",
+ 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.",
+ )