From 29eb6f2f9a65a876d6d276594cf6107ce57c29a4 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 22 Jan 2024 13:05:52 +0100 Subject: Add --skip-param-stats support to analyze-{archive,log} --- bin/analyze-archive.py | 8 +++++++- bin/analyze-kconfig.py | 9 --------- bin/analyze-log.py | 2 ++ lib/cli.py | 8 ++++++++ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 4641477..5df8af9 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -408,6 +408,7 @@ if __name__ == "__main__": pta=pta, pelt=args.with_substates, force_tree=args.force_tree, + compute_stats=not args.skip_param_stats, ) constructor_duration = time.time() - constructor_start @@ -424,7 +425,12 @@ if __name__ == "__main__": xv_method, xv_count = args.cross_validate.split(":") xv_count = int(xv_count) xv = CrossValidator( - PTAModel, by_name, parameters, arg_count, force_tree=args.force_tree + PTAModel, + by_name, + parameters, + arg_count, + force_tree=args.force_tree, + compute_stats=not args.skip_param_stats, ) xv.parameter_aware = args.parameter_aware_cross_validation else: diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py index 7714fdc..76e31dd 100755 --- a/bin/analyze-kconfig.py +++ b/bin/analyze-kconfig.py @@ -70,11 +70,6 @@ def main(): action="store_true", help="Show Kconfig symbols which are only present in a single configuration. Must be used with an experiment result directory.", ) - parser.add_argument( - "--skip-param-stats", - action="store_true", - help="Do not compute param stats that are required for RMT. Use this for large kconfig files.", - ) parser.add_argument( "--max-std", type=str, @@ -148,10 +143,6 @@ def main(): args = parser.parse_args() dfatool.cli.sanity_check(args) - if args.skip_param_stats and not args.force_tree: - print("--skip-param-stats requires --force-tree", file=sys.stderr) - sys.exit(1) - if args.log_level: numeric_level = getattr(logging, args.log_level.upper(), None) if not isinstance(numeric_level, int): diff --git a/bin/analyze-log.py b/bin/analyze-log.py index e3ddef8..2dbbfdc 100755 --- a/bin/analyze-log.py +++ b/bin/analyze-log.py @@ -96,6 +96,7 @@ def main(): by_name, parameter_names, force_tree=args.force_tree, + compute_stats=not args.skip_param_stats, function_override=function_override, ) @@ -156,6 +157,7 @@ def main(): by_name, parameter_names, force_tree=args.force_tree, + compute_stats=not args.skip_param_stats, ) xv.parameter_aware = args.parameter_aware_cross_validation else: diff --git a/lib/cli.py b/lib/cli.py index e7551df..89f0106 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -16,6 +16,9 @@ def sanity_check(args): "--force-tree and DFATOOL_FIT_FOL=1 are mutually exclusive", file=sys.stderr ) sys.exit(1) + if args.skip_param_stats and not args.force_tree: + print("--skip-param-stats requires --force-tree", file=sys.stderr) + sys.exit(1) def print_static(model, static_model, name, attribute, with_dependence=False): @@ -598,6 +601,11 @@ def add_standard_arguments(parser): "ssr : Sum of Squared Residuals\n" "rsq : R² Score", ) + parser.add_argument( + "--skip-param-stats", + action="store_true", + help="Do not compute param stats that are required for RMT. Use this for high-dimensional feature spaces.", + ) parser.add_argument( "--force-tree", action="store_true", -- cgit v1.2.3