Skip to content

Fixes in Unresolved comment '# TODO: remove placeholding zeroed y' and Fixes in Unresolved comment '# TODO: add float values'.#2

Merged
marcialouis merged 1 commit intomainfrom
codeqlty
Mar 7, 2025
Merged

Fixes in Unresolved comment '# TODO: remove placeholding zeroed y' and Fixes in Unresolved comment '# TODO: add float values'.#2
marcialouis merged 1 commit intomainfrom
codeqlty

Conversation

@ashageor
Copy link
Copy Markdown
Collaborator

@ashageor ashageor commented Mar 7, 2025

Description

Fixes in Unresolved comment '# TODO: remove placeholding zeroed y'. lines of code = 1 in sklbench\datasets\loaders.py:804

Originally it was like y = np.zeros((x.shape[0],))
Changed it to y = np.zeros(x.shape[0])
image

Fixes in Unresolved comment '# TODO: add float values'. lines of code = 1 in Found in [sklbench\utils\special_params.py:48]
I added a function in special_params.py called def float_range(start,stop,step) to accept float values
I tested it in Python:

import sklbench.utils.special_params as spl
spl.explain_range('[RANGE]add:1:5:1')
[1.0, 2.0, 3.0, 4.0, 5.0]
spl.explain_range('[RANGE]add:1.1:5.1:.2')
[1.1, 1.3, 1.5, 1.7, 1.9, 2.1, 2.3000000000000003, 2.5000000000000004, 2.7000000000000006, 2.900000000000001, 3.100000000000001, 3.300000000000001, 3.5000000000000013, 3.7000000000000015, 3.9000000000000017, 4.100000000000001, 4.300000000000002, 4.500000000000002, 4.700000000000002, 4.900000000000002, 5.100000000000002]
spl.explain_range('[RANGE]mul:1.1:5.1:.2')
However for the geometric progression, make sure the step value is greater than 1 as the result gets progressively smaller and will never converge. We can do a comparison for step size to be greater than 1 (currently not implemented)
spl.explain_range('[RANGE]mul:1.1:5.1:2')
[1.1, 2.2, 4.4]
spl.explain_range('[RANGE]pow:1.1:5.1:2')
[]
spl.explain_range('[RANGE]pow:1.1:10:2')
[]
spl.explain_range('[RANGE]pow:0.2:1.1:5.1:2')
[0.1702679845041569, 0.006810719380166277, 0.00027242877520665133]


PR should start as a draft, then move to ready for review state after CI is passed and all applicable checkboxes are closed.
This approach ensures that reviewers don't spend extra time asking for regular requirements.

You can remove a checkbox as not applicable only if it doesn't relate to this PR in any way.

Checklist to comply with before moving PR from draft:

PR completeness and readability

  • I have reviewed my changes thoroughly before submitting this pull request.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with update and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have added a respective label(s) to PR if I have a permission for that.
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • [X ] I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

… and Unresolved comment '# TODO: add float values'. lines of code = 1
@marcialouis marcialouis merged commit 7c7f1f9 into main Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants