summaryrefslogtreecommitdiff
path: root/bin/analyze-kconfig.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-01-05 15:23:51 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2022-01-05 15:23:51 +0100
commit2c5bcd77f2c952cc5269ca3e4b6e0a7323ebd085 (patch)
tree93da4dc33c77855445e6aa21f45c12b1803861fa /bin/analyze-kconfig.py
parentd9aee2a314ae6d3fc0216893a4ccfd8bb66ffa9c (diff)
cross validation: return intermediate models used for XV
These are interesting for statistics, e.g. to determine the average dtree size
Diffstat (limited to 'bin/analyze-kconfig.py')
-rwxr-xr-xbin/analyze-kconfig.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py
index bd9cccb..048c8c9 100755
--- a/bin/analyze-kconfig.py
+++ b/bin/analyze-kconfig.py
@@ -237,19 +237,21 @@ def main():
fit_duration = time.time() - fit_start_time
if xv_method == "montecarlo":
- static_quality = xv.montecarlo(lambda m: m.get_static(), xv_count)
- analytic_quality = xv.montecarlo(lambda m: m.get_fitted()[0], xv_count)
+ static_quality, _ = xv.montecarlo(lambda m: m.get_static(), xv_count)
+ analytic_quality, _ = xv.montecarlo(lambda m: m.get_fitted()[0], xv_count)
if lut_model:
- lut_quality = xv.montecarlo(
+ lut_quality, _ = xv.montecarlo(
lambda m: m.get_param_lut(fallback=True), xv_count
)
else:
lut_quality = None
elif xv_method == "kfold":
- static_quality = xv.kfold(lambda m: m.get_static(), xv_count)
- analytic_quality = xv.kfold(lambda m: m.get_fitted()[0], xv_count)
+ static_quality, _ = xv.kfold(lambda m: m.get_static(), xv_count)
+ analytic_quality, _ = xv.kfold(lambda m: m.get_fitted()[0], xv_count)
if lut_model:
- lut_quality = xv.kfold(lambda m: m.get_param_lut(fallback=True), xv_count)
+ lut_quality, _ = xv.kfold(
+ lambda m: m.get_param_lut(fallback=True), xv_count
+ )
else:
lut_quality = None
else:
@@ -315,9 +317,9 @@ def main():
json.dump(json_model, f, sort_keys=True, cls=dfatool.utils.NpEncoder)
if xv_method == "montecarlo":
- static_quality = xv.montecarlo(lambda m: m.get_static(), xv_count)
+ static_quality, _ = xv.montecarlo(lambda m: m.get_static(), xv_count)
elif xv_method == "kfold":
- static_quality = xv.kfold(lambda m: m.get_static(), xv_count)
+ static_quality, _ = xv.kfold(lambda m: m.get_static(), xv_count)
else:
static_quality = model.assess(static_model)