@@ -168,7 +168,6 @@ def _find_candidate_parameters(
168
168
linf_sum_bounds .append (
169
169
_find_candidates_bins_max_values_subsample (
170
170
hist .linf_sum_contributions_histogram , max_linf_candidates ))
171
- # min_sum_per_partition_bounds = [0] * len(max_sum_per_partition_bounds)
172
171
else : # n_sums > 1
173
172
for i in range (n_sum_columns ):
174
173
linf_sum_bounds .append (
@@ -178,33 +177,37 @@ def _find_candidate_parameters(
178
177
179
178
# Linf COUNT and SUM bounds can have different number of elements, for
180
179
# running Utility Analysis it is required that they have the same length.
181
- # Let us do padding with 0-th element.
182
- max_linf_size = 1 # max len of counts and sum bounds
180
+ # Let us pad each to the max_length with 0-th element.
181
+ max_linf_len = 1 # max len of counts and sum bounds
183
182
if tune_count_linf :
184
- max_linf_size = len (linf_count_bounds )
183
+ max_linf_len = len (linf_count_bounds )
185
184
if tune_sum_linf :
186
- max_linf_size = max (max_linf_size , max (map (len , linf_sum_bounds )))
185
+ max_linf_len = max (max_linf_len , max (map (len , linf_sum_bounds )))
187
186
188
187
if tune_count_linf :
189
- _pad_list (linf_count_bounds , max_linf_size )
188
+ _pad_list (linf_count_bounds , max_linf_len )
190
189
if tune_sum_linf :
191
190
for a in linf_sum_bounds :
192
- _pad_list (a , max_linf_size )
191
+ _pad_list (a , max_linf_len )
193
192
194
193
min_sum_per_partition = max_sum_per_partition = None
195
194
if tune_sum_linf :
196
- max_linf_size = max (max_linf_size , len (linf_sum_bounds ))
195
+ max_linf_len = max (max_linf_len , len (linf_sum_bounds ))
197
196
n_sum_columns = hist .num_sum_histograms ()
198
197
if n_sum_columns == 1 :
199
198
max_sum_per_partition = linf_sum_bounds [0 ]
200
199
min_sum_per_partition = [0 ] * len (max_sum_per_partition )
201
- else : # > 1
200
+ else : # n_sum_columns > 1
202
201
max_sum_per_partition = list (zip (* linf_sum_bounds ))
203
202
min_sum_per_partition = [
204
203
(0 ,) * n_sum_columns for _ in range (len (max_sum_per_partition ))
205
204
]
206
205
207
- l0_duplication = max_linf_size
206
+ # Make cross-product of l0 and linf bounds. That is done by duplicating
207
+ # each element of l0 bounds and by duplicating the whole arrays of linf
208
+ # bounds. Example if l0_bound = [1,2] and linf_bounds = [3,4], then
209
+ # l0_bounds will be [1,1,2,2] and linf_bounds will be [3,4,3,4].
210
+ l0_duplication = max_linf_len
208
211
linf_duplication = 1 if l0_bounds is None else len (l0_bounds )
209
212
return analysis .MultiParameterConfiguration (
210
213
max_partitions_contributed = _duplicate_each_element (
0 commit comments