Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8724ed4

Browse files
committedMar 6, 2025·
Changes for Unresolved comment '# TODO: remove placeholding zeroed y' and Unresolved comment '# TODO: add float values'. lines of code = 1
1 parent be6c6b5 commit 8724ed4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
 

Diff for: ‎sklbench/datasets/loaders.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,8 @@ def load_ann_dataset_template(url, raw_data_cache):
802802
}
803803
del x_train, x_test
804804
# TODO: remove placeholding zeroed y
805-
y = np.zeros((x.shape[0],))
805+
#y = np.zeros((x.shape[0],))
806+
y = np.zeros(x.shape[0])
806807
return {"x": x, "y": y}, data_desc
807808

808809

Diff for: ‎sklbench/utils/special_params.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
def is_special_value(value) -> bool:
3737
return isinstance(value, str) and value.startswith(SP_VALUE_STR)
3838

39+
def float_range(start,stop,step):
40+
while start < stop:
41+
yield start
42+
start += step
3943

4044
def explain_range(range_str: str) -> List:
4145
def check_range_values_size(range_values: List[int], size: int):
@@ -47,13 +51,15 @@ def check_range_values_size(range_values: List[int], size: int):
4751
range_values = range_str.replace("[RANGE]", "").split(":")
4852
# TODO: add float values
4953
range_type = range_values[0]
50-
range_values = list(map(int, range_values[1:]))
54+
#range_values = list(map(int, range_values[1:]))
55+
range_values = list(map(float, range_values[1:]))
5156
# - add:start{int}:end{int}:step{int} - Arithmetic progression
5257
# Sequence: start + step * i <= end
5358
if range_type == "add":
5459
check_range_values_size(range_values, 3)
5560
start, end, step = range_values
56-
return list(range(start, end + step, step))
61+
#return list(range(start, end + step, step))
62+
return list(float_range(start, end + step, step))
5763
# - mul:current{int}:end{int}:step{int} - Geometric progression
5864
# Sequence: current * step <= end
5965
elif range_type == "mul":
@@ -71,7 +77,8 @@ def check_range_values_size(range_values: List[int], size: int):
7177
range_values.append(1)
7278
check_range_values_size(range_values, 4)
7379
base, start, end, step = range_values
74-
return [base**i for i in range(start, end + step, step)]
80+
#return [base**i for i in range(start, end + step, step)]
81+
return [base**i for i in float_range(start, end + step, step)]
7582
else:
7683
raise ValueError(f'Unknown "{range_type}" range type')
7784

0 commit comments

Comments
 (0)
Please sign in to comment.