Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Parameter Validation #33

Closed
jinlow opened this issue May 15, 2023 · 3 comments
Closed

Add Parameter Validation #33

jinlow opened this issue May 15, 2023 · 3 comments
Assignees

Comments

@jinlow
Copy link
Owner

jinlow commented May 15, 2023

Right now there are a lot of parameters that have required ranges that are not being validated. There is some validation defined by the constraints of the types (usize can't be negative for instance), but this should all be handled in one place.
Create a InvalidInputParameter error, and then inside of GradientBooster::new check for valid parameters returning an error if some criteria are not met.

@gravesee
Copy link
Collaborator

This looks helpful: https://crates.io/crates/validator

@jinlow jinlow self-assigned this May 19, 2023
@jinlow
Copy link
Owner Author

jinlow commented May 21, 2023

Checked out this package, pretty cool! After some testing, it ended up being easier to just write a small function to validate the float params. Additionally, reading through this issue it has some thorns/maintenance concerns. The nice thing is, most of the parameters are self validating by their actual data types, so the only validation that currently needs to happen is to make sure some floats are positive.

@jinlow
Copy link
Owner Author

jinlow commented May 22, 2023

Merged, and released

@jinlow jinlow closed this as completed May 22, 2023
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

No branches or pull requests

2 participants