diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-06-28 16:38:40 +0200 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-06-28 16:38:40 +0200 |
commit | 7d6d1984b010cd2ddb47f04065c528837b53bfba (patch) | |
tree | eb70595f3e509e9fb1556d1142baf028a5e9542d /bin | |
parent | 31a4e67625730f765943e5b60c401d8027a50a96 (diff) |
analyze-log: add --information-gain
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/analyze-log.py | 13 |
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 ) |