summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-02-09 08:52:01 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-02-09 08:52:01 +0100
commitc806d27c1d5d2495096be83911d84ea5ed43d0ee (patch)
tree324922526828fa8ed1768bc4cc665e21b831708e
parentd6ac8c11f2dd957ef721374fa755cc99b09bc7ca (diff)
add --param-shift=param=categorial option
-rw-r--r--lib/cli.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/cli.py b/lib/cli.py
index e2c8779..fb1e722 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -583,7 +583,7 @@ def add_standard_arguments(parser):
)
parser.add_argument(
"--param-shift",
- metavar="<key>=<+|-|*|/><value>|none-to-0;...",
+ metavar="<key>=<+|-|*|/><value>|none-to-0|categorial;...",
type=str,
help="Adjust parameter values before passing them to model generation",
)
@@ -681,6 +681,8 @@ def parse_shift_function(param_name, param_shift):
elif param_shift.startswith("/"):
param_shift_value = float(param_shift[1:])
return lambda p: p / param_shift_value
+ elif param_shift == "categorial":
+ return lambda p: "=" + str(p)
elif param_shift == "none-to-0":
return lambda p: p or 0
else: