From aa620d777c7fa4d09eea45a1cf18c64c9716af8f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 8 Oct 2021 15:10:48 +0200 Subject: analyze-kconfig: show expected model performance --- bin/analyze-kconfig.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py index da97c58..6887489 100755 --- a/bin/analyze-kconfig.py +++ b/bin/analyze-kconfig.py @@ -118,6 +118,17 @@ def main(): for attr in model.by_name[name]["attributes"]: # TODO specify correct threshold model.build_dtree(name, attr, 20) + model.fit_done = True + + param_model, param_info = model.get_fitted() + analytic_quality = model.assess(param_model) + + print("Model Error on Training Data:") + for name in model.names: + for attribute, error in analytic_quality[name].items(): + mae = error["mae"] + smape = error["smape"] + print(f"{name:15s} {attribute:20s} ± {mae:5.0} / {smape:5.1f}%") else: raise NotImplementedError() -- cgit v1.2.3