diff --git a/scripts/calculate_values.py b/scripts/calculate_values.py index 2a89b77f..7bf87d6f 100644 --- a/scripts/calculate_values.py +++ b/scripts/calculate_values.py @@ -94,10 +94,14 @@ def _calculate_values( ) params = load_params_fast() - cache_group = params["valuation_methods"][valuation_method_name]["cache_group"] - cache_backend = DiskCacheBackend( - Path(".cache") / experiment_name / dataset_name / model_name / cache_group - ) + + cache = None + if "cache_group" in params["valuation_methods"][valuation_method_name]: + cache_group = params["valuation_methods"][valuation_method_name]["cache_group"] + cache = DiskCacheBackend( + Path(".cache") / experiment_name / dataset_name / model_name / cache_group + ) + val_set = Accessor.datasets(experiment_name, dataset_name).loc[0, "val_set"] n_pipeline_step = 4 @@ -119,7 +123,7 @@ def _calculate_values( model=model, scorer=Scorer("accuracy", default=0.0), catch_errors=True, - cache_backend=cache_backend, + cache_backend=cache, ), valuation_method=algorithm_name, n_jobs=n_jobs, diff --git a/scripts/evaluate_metrics.py b/scripts/evaluate_metrics.py index be48ac80..58c8f45b 100644 --- a/scripts/evaluate_metrics.py +++ b/scripts/evaluate_metrics.py @@ -128,7 +128,10 @@ def _evaluate_metrics( seed = pipeline_seed(repetition_id, n_pipeline_step) cache = None - if "eval_model" in metric_kwargs: + if ( + "eval_model" in metric_kwargs + and "cache_group" in params["valuation_methods"][valuation_method_name] + ): cache_group = params["valuation_methods"][valuation_method_name]["cache_group"] cache = DiskCacheBackend( Path(".cache")