diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-07-02 09:29:01 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-07-02 09:29:01 +0200 |
commit | feafeb9f619d426201b98d05e4feb77c8b1cf4a3 (patch) | |
tree | c7901ad41847cb9e2c8ced1372128e26b6686058 /lib/parameters.py | |
parent | 2833115dff3da0e9b9a84fc5642b3a43034b27af (diff) |
Use logging module for debug output
Diffstat (limited to 'lib/parameters.py')
-rw-r--r-- | lib/parameters.py | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/lib/parameters.py b/lib/parameters.py index 8b562b6..bd67cc1 100644 --- a/lib/parameters.py +++ b/lib/parameters.py @@ -1,4 +1,5 @@ import itertools +import logging import numpy as np from collections import OrderedDict from copy import deepcopy @@ -6,6 +7,8 @@ from multiprocessing import Pool from .utils import remove_index_from_tuple, is_numeric from .utils import filter_aggregate_by_param, by_name_to_by_param +logger = logging.getLogger(__name__) + def distinct_param_values(by_name, state_or_tran): """ @@ -94,9 +97,7 @@ def _codependent_parameters(param, lut_by_param_values, std_by_param_values): return influencer_parameters -def _std_by_param( - by_param, all_param_values, state_or_tran, attribute, param_index, verbose=False -): +def _std_by_param(by_param, all_param_values, state_or_tran, attribute, param_index): u""" Calculate standard deviations for a static model where all parameters but `param_index` are constant. @@ -229,7 +230,6 @@ def _compute_param_statistics( attribute, distinct_values, distinct_values_by_param_index, - verbose=False, ): """ Compute standard deviation and correlation coefficient for various data partitions. @@ -252,7 +252,6 @@ def _compute_param_statistics( :param arg_count: dict providing the number of functions args ("local parameters") for each function. :param state_or_trans: state or transition name, e.g. 'send' or 'TX' :param attribute: model attribute, e.g. 'power' or 'duration' - :param verbose: print warning if some parameter partitions are too small for fitting :returns: a dict with the following content: std_static -- static parameter-unaware model error: stddev of by_name[state_or_trans][attribute] @@ -299,7 +298,6 @@ def _compute_param_statistics( state_or_trans, attribute, param_idx, - verbose, ) ret["std_by_param"][param] = mean_std ret["std_by_param_values"][param] = std_matrix @@ -351,7 +349,6 @@ def _compute_param_statistics( state_or_trans, attribute, param_idx, - verbose, ) ret["param_data"][param]["depends_for_codependent_value"][ combi @@ -365,7 +362,6 @@ def _compute_param_statistics( state_or_trans, attribute, len(parameter_names) + arg_index, - verbose, ) ret["std_by_arg"].append(mean_std) ret["std_by_arg_values"].append(std_matrix) @@ -495,13 +491,7 @@ class ParamStats: """ def __init__( - self, - by_name, - by_param, - parameter_names, - arg_count, - use_corrcoef=False, - verbose=False, + self, by_name, by_param, parameter_names, arg_count, use_corrcoef=False, ): """ Compute standard deviation and correlation coefficient on parameterized data partitions. @@ -556,7 +546,6 @@ class ParamStats: attribute, self.distinct_values[state_or_tran], self.distinct_values_by_param_index[state_or_tran], - verbose, ], } ) |