summaryrefslogtreecommitdiff
path: root/lib/cli.py
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-06-28 16:38:40 +0200
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-06-28 16:38:40 +0200
commit7d6d1984b010cd2ddb47f04065c528837b53bfba (patch)
treeeb70595f3e509e9fb1556d1142baf028a5e9542d /lib/cli.py
parent31a4e67625730f765943e5b60c401d8027a50a96 (diff)
analyze-log: add --information-gain
Diffstat (limited to 'lib/cli.py')
-rw-r--r--lib/cli.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/cli.py b/lib/cli.py
index d2c9840..d59c997 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -92,6 +92,15 @@ def print_info_by_name(model, by_name):
)
+def print_information_gain_by_name(model, by_name):
+ for name in model.names:
+ for attr in model.attributes(name):
+ print(f"{name} {attr}:")
+ mutual_information = model.mutual_information(name, attr)
+ for i, param in enumerate(model.parameters):
+ print(f" Parameter {param} : {mutual_information[i]:5.2f}")
+
+
def print_analyticinfo(prefix, info):
model_function = info.model_function.removeprefix("0 + ")
for i in range(len(info.model_args)):
@@ -576,6 +585,11 @@ def add_standard_arguments(parser):
help="Show benchmark information (number of measurements, parameter values, ...)",
)
parser.add_argument(
+ "--information-gain",
+ action="store_true",
+ help="Show information gain of parameters",
+ )
+ parser.add_argument(
"--log-level",
metavar="LEVEL",
choices=["debug", "info", "warning", "error"],