Skip to content

Commit c727624

Browse files
ENH: Enforce strict boolean type check for 'shrinking' hyperparameter
1 parent 849f970 commit c727624

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

orca_python/classifiers/REDSVM.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ def fit(self, X, y):
150150
If parameters are invalid or data has wrong format.
151151
152152
"""
153+
# Additional strict validation for boolean parameters
154+
if not isinstance(self.shrinking, bool):
155+
raise ValueError(
156+
f"The 'shrinking' parameter must be of type bool. "
157+
f"Got {type(self.shrinking).__name__} instead."
158+
)
159+
153160
# Check that X and y have correct shape
154161
X, y = check_X_y(X, y)
155162
# Store the classes seen during fit

0 commit comments

Comments
 (0)