summaryrefslogtreecommitdiff
path: root/lib/model.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-10-25 11:47:02 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2021-10-25 11:47:02 +0200
commite61a2593f38bbfee1e36edc8358abd71c6ac7ad1 (patch)
tree2953d160d8e052b151f3e66a17f90921da5385ad /lib/model.py
parent53a1c3d98527795ec84e55695fae36d7a1421149 (diff)
model: Remove legacy with_function_leaves override
Diffstat (limited to 'lib/model.py')
-rw-r--r--lib/model.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/model.py b/lib/model.py
index 844ec89..f926495 100644
--- a/lib/model.py
+++ b/lib/model.py
@@ -275,9 +275,12 @@ class AnalyticModel:
for name in self.names:
for attr in self.attr_by_name[name].keys():
if tree_required[name].get(attr, False):
- with_function_leaves = True
- if os.getenv("DFATOOL_DTREE_FUNCTION_LEAVES") == "0":
- with_function_leaves = False
+ with_function_leaves = bool(
+ int(os.getenv("DFATOOL_DTREE_FUNCTION_LEAVES", "1"))
+ )
+ logger.debug(
+ f"build_dtree({name}, {attr}, threshold={self.attr_by_name[name][attr].stats.std_param_lut}, with_function_leaves={with_function_leaves})"
+ )
self.build_dtree(
name,
attr,
@@ -368,8 +371,6 @@ class AnalyticModel:
)
# temporary hack for ResKIL / kconfig-webconf evaluation of regression trees with function nodes
- if not with_function_leaves:
- with_function_leaves = bool(os.getenv("DFATOOL_DTREE_FUNCTION_LEAVES"))
if (
with_function_leaves
and attribute in "accuracy model_size_mb power_w".split()