summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-06-15 08:43:04 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2022-06-15 08:43:04 +0200
commitc1dfcd4dca136da8dac5a2ec09e15d744f905734 (patch)
tree79c23b785ef64b47dc4dad93e2906fd8e193abca /lib
parent7e4b7f3e0132bd9f4ae903fb83b438ee0f4e07b2 (diff)
param_to_ndarray: handle parameters with numeric and non-numeric values
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/utils.py b/lib/utils.py
index ed21f0f..77f9954 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -244,8 +244,10 @@ def param_to_ndarray(
ret_tuple = list()
for i, param in enumerate(param_tuple):
if not ignore_index[i]:
- if i in category_to_scalar:
+ if i in category_to_scalar and not is_numeric(param):
ret_tuple.append(category_to_scalar[i][param])
+ elif categorial_to_scalar:
+ ret_tuple.append(soft_cast_int(param))
else:
ret_tuple.append(param)
ret_tuples.append(ret_tuple)