From d2db6320d24fba1aaa84329e086df91e4bd777db Mon Sep 17 00:00:00 2001 From: yu9824 <58211916+yu9824@users.noreply.github.com> Date: Sat, 6 May 2023 13:53:16 +0900 Subject: [PATCH] Remove kwargs to avoid error overhead. --- kennard_stone/kennard_stone.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kennard_stone/kennard_stone.py b/kennard_stone/kennard_stone.py index bc5528e..b3e52c2 100644 --- a/kennard_stone/kennard_stone.py +++ b/kennard_stone/kennard_stone.py @@ -44,7 +44,8 @@ def __init__( *, metric: str = "euclidean", n_jobs: Optional[int] = None, - **kwargs, + random_state: None = None, + shuffle: None = None, ) -> None: """K-Folds cross-validator using the Kennard-Stone algorithm. @@ -78,7 +79,7 @@ def __init__( self.metric = metric self.n_jobs = n_jobs - if "shuffle" in kwargs: + if shuffle is not None: warnings.warn( "`shuffle` is unnecessary because it is always shuffled" " in this algorithm.", @@ -86,7 +87,7 @@ def __init__( ) del self.shuffle - if "random_state" in kwargs: + if random_state is not None: warnings.warn( "`random_state` is unnecessary since it is uniquely determined" " in this algorithm.", @@ -166,7 +167,8 @@ def train_test_split( train_size: Optional[Union[float, int]] = None, metric: str = "euclidean", n_jobs: Optional[int] = None, - **kwargs, + random_state: None = None, + shuffle: None = None, ) -> list: """Split arrays or matrices into train and test subsets using the Kennard-Stone algorithm. @@ -223,14 +225,14 @@ def train_test_split( ------ ValueError """ - if "shuffle" in kwargs: + if shuffle is not None: warnings.warn( "`shuffle` is unnecessary because it is always shuffled" " in this algorithm.", UserWarning, ) - if "random_state" in kwargs: + if random_state is not None: warnings.warn( "`random_state` is unnecessary since it is uniquely determined" " in this algorithm.",