Skip to content

Commit

Permalink
UPD: No more error in test
Browse files Browse the repository at this point in the history
  • Loading branch information
SZiane committed Jul 11, 2023
1 parent 47562c5 commit 0c54e06
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion mapie/control_risk/ltt.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def ltt_procedure(
The procedure follows the instructions in [1]:
- Calculate p-values for each lambdas descretized
- Apply a fwer algorithm, here Bonferonni correction
- Apply a family wise error rate algorithm,
here Bonferonni correction
- Return the index lambdas that give you the control
at alpha level
Expand Down
14 changes: 7 additions & 7 deletions mapie/multi_label_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,23 +246,23 @@ def _check_delta(self, delta: Optional[float]):
Warning
If delta is not ``None`` and method is CRC
"""
if (not isinstance(delta, float)) and (delta is not None):
raise ValueError(
"Invalid delta. "
f"delta must be a float, not a {type(delta)}"
)
if (self.method == "rcps") or (self.method == "ltt"):
if delta is None:
raise ValueError(
"Invalid delta. "
"delta cannot be ''None'' when using "
"LTT method."
"delta cannot be ``None`` when using "
"RCPS or LTT method."
)
elif ((delta <= 0) or (delta >= 1)):
raise ValueError(
"Invalid delta. "
"delta must be in ]0, 1["
)
if (not isinstance(delta, float)) and (delta is not None):
raise ValueError(
"Invalid delta. "
f"delta must be a float, not a {type(delta)}"
)
if (self.method == "crc") and (delta is not None):
warnings.warn(
"WARNING: you are using crc method, hence "
Expand Down

0 comments on commit 0c54e06

Please sign in to comment.