diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-10-24 12:17:43 +0200 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-10-24 12:17:43 +0200 |
commit | a0933fef969c4555452fcbf70e6183eddf141956 (patch) | |
tree | 5246a776b4672e78bd0dda6d9da473a312c3a08e /lib/cli.py | |
parent | b8519f00d9c30a7726435aac6989455a7ba91afe (diff) |
add --add-total-observation for behaviour model evaluation
Diffstat (limited to 'lib/cli.py')
-rw-r--r-- | lib/cli.py | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -293,7 +293,11 @@ def model_quality_table( buf = f"{key:>{key_len}s} {attr:>{attr_len}s}" for results, info in ((lut, None), (model, model_info), (static, None)): buf += " " - if results is not None and ( + + # special case for "TOTAL" (--add-total-observation) + if attr == "TOTAL" and attr not in results[key]: + buf += f"""{"----":>7s} """ + elif results is not None and ( info is None or ( attr != "energy_Pt" @@ -311,7 +315,7 @@ def model_quality_table( buf += format_quality_measures(result, error_metric=error_metric) else: buf += f"""{"----":>7s} """ - if type(model_info(key, attr)) is not df.StaticFunction: + if attr != "TOTAL" and type(model_info(key, attr)) is not df.StaticFunction: if model[key][attr]["mae"] > static[key][attr]["mae"]: buf += " :-(" elif ( @@ -629,6 +633,11 @@ def add_standard_arguments(parser): help="Show model complexity score and details (e.g. regression tree height and node count)", ) parser.add_argument( + "--add-total-observation", + action="store_true", + help="Add a TOTAL observation for each <key> that consists of the sums of its <attribute> entries. This allows for cross-validation of behaviour models vs. non-behaviour-aware models.", + ) + parser.add_argument( "--cross-validate", metavar="<method>:<count>", type=str, |