imblearn/under_sampling/_prototype_selection/_random_under_sampler.py

Killed 13 out of 21 mutants

Survived

Survived mutation testing. These mutants show holes in your test suite.

Mutant 406

--- imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
+++ imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
@@ -72,7 +72,6 @@
     Resampled dataset shape Counter({{0: 100, 1: 100}})
     """
 
-    @_deprecate_positional_args
     def __init__(
         self, *, sampling_strategy="auto", random_state=None, replacement=False
     ):

Mutant 407

--- imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
+++ imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
@@ -74,7 +74,7 @@
 
     @_deprecate_positional_args
     def __init__(
-        self, *, sampling_strategy="auto", random_state=None, replacement=False
+        self, *, sampling_strategy="XXautoXX", random_state=None, replacement=False
     ):
         super().__init__(sampling_strategy=sampling_strategy)
         self.random_state = random_state

Mutant 408

--- imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
+++ imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
@@ -74,7 +74,7 @@
 
     @_deprecate_positional_args
     def __init__(
-        self, *, sampling_strategy="auto", random_state=None, replacement=False
+        self, *, sampling_strategy="auto", random_state=None, replacement=True
     ):
         super().__init__(sampling_strategy=sampling_strategy)
         self.random_state = random_state

Mutant 409

--- imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
+++ imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
@@ -77,7 +77,7 @@
         self, *, sampling_strategy="auto", random_state=None, replacement=False
     ):
         super().__init__(sampling_strategy=sampling_strategy)
-        self.random_state = random_state
+        self.random_state = None
         self.replacement = replacement
 
     def _check_X_y(self, X, y):

Mutant 410

--- imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
+++ imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
@@ -78,7 +78,7 @@
     ):
         super().__init__(sampling_strategy=sampling_strategy)
         self.random_state = random_state
-        self.replacement = replacement
+        self.replacement = None
 
     def _check_X_y(self, X, y):
         y, binarize_y = check_target_type(y, indicate_one_vs_all=True)

Mutant 414

--- imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
+++ imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
@@ -83,7 +83,7 @@
     def _check_X_y(self, X, y):
         y, binarize_y = check_target_type(y, indicate_one_vs_all=True)
         X, y = self._validate_data(
-            X, y, reset=True, accept_sparse=["csr", "csc"], dtype=None,
+            X, y, reset=True, accept_sparse=["XXcsrXX", "csc"], dtype=None,
             force_all_finite=False,
         )
         return X, y, binarize_y

Mutant 415

--- imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
+++ imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
@@ -83,7 +83,7 @@
     def _check_X_y(self, X, y):
         y, binarize_y = check_target_type(y, indicate_one_vs_all=True)
         X, y = self._validate_data(
-            X, y, reset=True, accept_sparse=["csr", "csc"], dtype=None,
+            X, y, reset=True, accept_sparse=["csr", "XXcscXX"], dtype=None,
             force_all_finite=False,
         )
         return X, y, binarize_y

Mutant 416

--- imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
+++ imblearn/under_sampling/_prototype_selection/_random_under_sampler.py
@@ -84,7 +84,7 @@
         y, binarize_y = check_target_type(y, indicate_one_vs_all=True)
         X, y = self._validate_data(
             X, y, reset=True, accept_sparse=["csr", "csc"], dtype=None,
-            force_all_finite=False,
+            force_all_finite=True,
         )
         return X, y, binarize_y