summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-01-11 15:54:03 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-01-11 15:54:03 +0100
commitbf79195b5bb6e5cb3688823b595006b169d92730 (patch)
tree623962e54cf3b017afdf766f236e0f571495e18e /bin
parent9705d6687def65a82193e60aa69137ab5bd1d047 (diff)
Rename --show-quality=table to --show-model-error
Diffstat (limited to 'bin')
-rwxr-xr-xbin/analyze-archive.py7
-rwxr-xr-xbin/analyze-kconfig.py28
-rwxr-xr-xbin/analyze-log.py9
3 files changed, 5 insertions, 39 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index 2f5e680..4b9b7b4 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -200,11 +200,10 @@ if __name__ == "__main__":
)
parser.add_argument(
"--show-quality",
- choices=["table", "summary"],
+ choices=["overall", "summary"],
action="append",
default=list(),
- help="table: show LUT, model, and static prediction error for each state/transition and attribute.\n"
- "summary: show static/fitted/lut SMAPE and MAE for each attribute, averaged over all states/transitions.",
+ help="summary: show static/fitted/lut SMAPE and MAE for each attribute, averaged over all states/transitions.",
)
parser.add_argument(
"--ignored-trace-indexes",
@@ -723,7 +722,7 @@ if __name__ == "__main__":
analytic_quality = model.assess(param_model)
xv_analytic_models = None
- if "table" in show_quality or "all" in show_quality:
+ if args.show_model_error:
dfatool.cli.model_quality_table(
lut=lut_quality,
model=analytic_quality,
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py
index bc47242..4cf03b5 100755
--- a/bin/analyze-kconfig.py
+++ b/bin/analyze-kconfig.py
@@ -143,13 +143,6 @@ def main():
help="Restrict model generation to N random samples",
metavar="N",
)
- parser.add_argument(
- "--show-quality",
- choices=["table"],
- action="append",
- default=list(),
- help="table: show LUT, model, and static prediction error for each key and attribute.",
- )
parser.add_argument("kconfig_path", type=str, help="Path to Kconfig file")
parser.add_argument(
"model",
@@ -525,7 +518,7 @@ def main():
f"{name:20s} {attribute:15s}", info, model.parameters
)
- if "table" in args.show_quality or "all" in args.show_quality:
+ if args.show_model_error:
dfatool.cli.model_quality_table(
lut=lut_quality,
model=analytic_quality,
@@ -536,25 +529,6 @@ def main():
error_metric=args.error_metric,
)
- if not args.show_quality:
- if xv_method is not None:
- print(f"Model Error after Cross Validation ({xv_method}, {xv_count}):")
- else:
- print("Model Error on Training Data:")
- for name in sorted(model.names):
- for attribute, error in sorted(
- analytic_quality[name].items(), key=lambda kv: kv[0]
- ):
- mae = error["mae"]
- mape = error["mape"]
- smape = error["smape"]
- if mape is not None:
- print(f"{name:15s} {attribute:20s} ± {mae:10.2} / {mape:5.1f}%")
- else:
- print(
- f"{name:15s} {attribute:20s} ± {mae:10.2} / {smape:5.1f}% SMAPE"
- )
-
if args.show_model_size:
dfatool.cli.print_model_size(model)
diff --git a/bin/analyze-log.py b/bin/analyze-log.py
index be11f5d..e8f3a84 100755
--- a/bin/analyze-log.py
+++ b/bin/analyze-log.py
@@ -37,13 +37,6 @@ def main():
)
dfatool.cli.add_standard_arguments(parser)
parser.add_argument(
- "--show-quality",
- choices=["table"],
- action="append",
- default=list(),
- help="table: show LUT, model, and static prediction error for each key and attribute.",
- )
- parser.add_argument(
"--force-tree",
action="store_true",
help="Build decision tree without checking for analytic functions first",
@@ -222,7 +215,7 @@ def main():
f"{name:10s} {attribute:15s}", info, model.parameters
)
- if "table" in args.show_quality or "all" in args.show_quality:
+ if args.show_model_error:
dfatool.cli.model_quality_table(
lut=lut_quality,
model=analytic_quality,