diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-02-09 08:52:01 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-02-09 08:52:01 +0100 |
commit | c806d27c1d5d2495096be83911d84ea5ed43d0ee (patch) | |
tree | 324922526828fa8ed1768bc4cc665e21b831708e | |
parent | d6ac8c11f2dd957ef721374fa755cc99b09bc7ca (diff) |
add --param-shift=param=categorial option
-rw-r--r-- | lib/cli.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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: |