summaryrefslogtreecommitdiff
path: root/bin
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 /bin
parent31a4e67625730f765943e5b60c401d8027a50a96 (diff)
analyze-log: add --information-gain
Diffstat (limited to 'bin')
-rwxr-xr-xbin/analyze-log.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/analyze-log.py b/bin/analyze-log.py
index a394b10..50c0344 100755
--- a/bin/analyze-log.py
+++ b/bin/analyze-log.py
@@ -124,6 +124,9 @@ def main():
if args.info:
dfatool.cli.print_info_by_name(model, by_name)
+ if args.information_gain:
+ dfatool.cli.print_information_gain_by_name(model, by_name)
+
if args.export_csv_unparam:
dfatool.cli.export_csv_unparam(
model, args.export_csv_unparam, dialect=args.export_csv_dialect
@@ -278,6 +281,16 @@ def main():
dref = model.to_dref(static_quality, lut_quality, analytic_quality)
for key, value in timing.items():
dref[f"timing/{key}"] = (value, r"\second")
+
+ if args.information_gain:
+ for name in model.names:
+ for attr in model.attributes(name):
+ mutual_information = model.mutual_information(name, attr)
+ for i, param in enumerate(model.parameters):
+ dref[f"mutual information/{name}/{attr}/{param}"] = (
+ mutual_information[i]
+ )
+
dfatool.cli.export_dataref(
args.export_dref, dref, precision=args.dref_precision
)