Skip to content

Commit

Permalink
[Feature] add quantiles validation logic (#21)
Browse files Browse the repository at this point in the history
Exception for 0 or 1 alphas
  • Loading branch information
RektPunk authored Aug 27, 2024
1 parent 933f4d0 commit 5c2e869
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ repos:
- id: check-yaml
- id: check-json
- repo: https://github.com/psf/black
rev: stable
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
3 changes: 3 additions & 0 deletions mqboost/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def alpha_validate(
if isinstance(alphas, float):
alphas = [alphas]

if 0.0 in alphas or 1.0 in alphas:
raise ValidationException("Alpha cannot be 0 or 1")

_len_alphas = len(alphas)
if _len_alphas == 0:
raise ValidationException("Input alpha is not valid")
Expand Down

0 comments on commit 5c2e869

Please sign in to comment.