From 7d6d1984b010cd2ddb47f04065c528837b53bfba Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 28 Jun 2024 16:38:40 +0200 Subject: analyze-log: add --information-gain --- lib/cli.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/cli.py') 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)): @@ -575,6 +584,11 @@ def add_standard_arguments(parser): action="store_true", 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", -- cgit v1.2.3