Repository: feature-engine/feature_engine

Issue:
change name of parameter errors by unseen in categorical encoders
The change should be done with a deprecation cycle.

Discussion:

Patch:
diff --git a/feature_engine/_prediction/base_predictor.py b/feature_engine/_prediction/base_predictor.py
index 3ab45be..2b0d143 100644
--- a/feature_engine/_prediction/base_predictor.py
+++ b/feature_engine/_prediction/base_predictor.py
@@ -177,7 +177,7 @@ class BaseTargetMeanEstimator(BaseEstimator):
         Create pipeline for a dataframe solely comprised of numerical variables
         using a discretiser and an encoder.
         """
-        encoder = MeanEncoder(variables=self.variables_numerical_, errors="raise")
+        encoder = MeanEncoder(variables=self.variables_numerical_, unseen="raise")
 
         pipeline = Pipeline(
             [
@@ -193,14 +193,14 @@ class BaseTargetMeanEstimator(BaseEstimator):
         Instantiate the target mean encoder. Used when all variables are categorical.
         """
 
-        pipeline = MeanEncoder(variables=self.variables_categorical_, errors="raise")
+        pipeline = MeanEncoder(variables=self.variables_categorical_, unseen="raise")
 
         return pipeline
 
     def _make_combined_pipeline(self):
 
-        encoder_num = MeanEncoder(variables=self.variables_numerical_, errors="raise")
-        encoder_cat = MeanEncoder(variables=self.variables_categorical_, errors="raise")
+        encoder_num = MeanEncoder(variables=self.variables_numerical_, unseen="raise")
+        encoder_cat = MeanEncoder(variables=self.variables_categorical_, unseen="raise")
 
         pipeline = Pipeline(
             [
diff --git a/feature_engine/encoding/_docstrings.py b/feature_engine/encoding/_docstrings.py
index d2d9617..654ac01 100644
--- a/feature_engine/encoding/_docstrings.py
+++ b/feature_engine/encoding/_docstrings.py
@@ -13,7 +13,7 @@ _ignore_format_docstring = """ignore_format: bool, default=False
         accept all variables entered by the user, including those cast as numeric.
     """.rstrip()
 
-_errors_docstring = """errors: string, default='ignore'
+_unseen_docstring = """unseen: string, default='ignore'
         Indicates what to do, when categories not present in the train set are
         encountered during transform. If 'raise', then unseen categories will raise an
         error. If 'ignore', then unseen categories will be set as NaN and a warning will
diff --git a/feature_engine/encoding/_helper_functions.py b/feature_engine/encoding/_helper_functions.py
index 6d4b415..50f302a 100644
--- a/feature_engine/encoding/_helper_functions.py
+++ b/feature_engine/encoding/_helper_functions.py
@@ -1,4 +1,4 @@
-def check_parameter_errors(errors, accepted_values):
+def check_parameter_unseen(errors, accepted_values):
     if errors not in accepted_values:
         raise ValueError(
             f"errors takes only values {', '.join(accepted_values)}."
diff --git a/feature_engine/encoding/base_encoder.py b/feature_engine/encoding/base_encoder.py
index 376b699..afa6cae 100644
--- a/feature_engine/encoding/base_encoder.py
+++ b/feature_engine/encoding/base_encoder.py
@@ -13,11 +13,11 @@ from feature_engine.dataframe_checks import (
     check_X,
 )
 from feature_engine.encoding._docstrings import (
-    _errors_docstring,
+    _unseen_docstring,
     _ignore_format_docstring,
     _variables_docstring,
 )
-from feature_engine.encoding._helper_functions import check_parameter_errors
+from feature_engine.encoding._helper_functions import check_parameter_unseen
 from feature_engine.get_feature_names_out import _get_feature_names_out
 from feature_engine.tags import _return_tags
 from feature_engine.variable_manipulation import (
@@ -60,7 +60,7 @@ class CategoricalInitMixin:
 @Substitution(
     ignore_format=_ignore_format_docstring,
     variables=_variables_docstring,
-    errors=_errors_docstring,
+    unseen=_unseen_docstring,
 )
 class CategoricalInitExpandedMixin(CategoricalInitMixin):
     """Shared initialization parameters across transformers. Contains additional
@@ -72,18 +72,18 @@ class CategoricalInitExpandedMixin(CategoricalInitMixin):
 
     {ignore_format}
 
-    {errors}
+    {unseen}
     """
 
     def __init__(
         self,
         variables: Union[None, int, str, List[Union[str, int]]] = None,
         ignore_format: bool = False,
-        errors: str = "ignore",
+        unseen: str = "ignore",
     ) -> None:
-        check_parameter_errors(errors, ["raise", "ignore"])
+        check_parameter_unseen(unseen, ["raise", "ignore"])
         super().__init__(variables, ignore_format)
-        self.errors = errors
+        self.unseen = unseen
 
 
 @Substitution(
@@ -231,12 +231,12 @@ class CategoricalMethodsMixin(BaseEstimator, TransformerMixin):
             else:
                 nan_columns_str = nan_columns[0]
 
-            if self.errors == "ignore":
+            if self.unseen == "ignore":
                 warnings.warn(
                     "During the encoding, NaN values were introduced in the feature(s) "
                     f"{nan_columns_str}."
                 )
-            elif self.errors == "raise":
+            elif self.unseen == "raise":
                 raise ValueError(
                     "During the encoding, NaN values were introduced in the feature(s) "
                     f"{nan_columns_str}."
diff --git a/feature_engine/encoding/count_frequency.py b/feature_engine/encoding/count_frequency.py
index 6dfe41b..e744037 100644
--- a/feature_engine/encoding/count_frequency.py
+++ b/feature_engine/encoding/count_frequency.py
@@ -18,27 +18,27 @@ from feature_engine._docstrings.methods import (
 from feature_engine._docstrings.substitute import Substitution
 from feature_engine.dataframe_checks import check_X
 from feature_engine.encoding._docstrings import (
-    _errors_docstring,
+    _unseen_docstring,
     _ignore_format_docstring,
     _transform_docstring,
     _variables_docstring,
 )
-from feature_engine.encoding._helper_functions import check_parameter_errors
+from feature_engine.encoding._helper_functions import check_parameter_unseen
 from feature_engine.encoding.base_encoder import (
     CategoricalInitMixin,
     CategoricalMethodsMixin,
 )
 
-_errors_docstring = (
-    _errors_docstring
-    + """ If `'encode'`, unseen categories will be encoded as 0 (zero)."""
+_unseen_docstring = (
+        _unseen_docstring
+        + """ If `'encode'`, unseen categories will be encoded as 0 (zero)."""
 )
 
 
 @Substitution(
     ignore_format=_ignore_format_docstring,
     variables=_variables_docstring,
-    errors=_errors_docstring,
+    unseen=_unseen_docstring,
     variables_=_variables_attribute_docstring,
     feature_names_in_=_feature_names_in_docstring,
     n_features_in_=_n_features_in_docstring,
@@ -83,7 +83,7 @@ class CountFrequencyEncoder(CategoricalInitMixin, CategoricalMethodsMixin):
 
     {ignore_format}
 
-    {errors}
+    {unseen}
 
     Attributes
     ----------
@@ -111,7 +111,7 @@ class CountFrequencyEncoder(CategoricalInitMixin, CategoricalMethodsMixin):
     -----
     NAN will be introduced when encoding categories that were not present in the
     training set. If this happens, try grouping infrequent categories using the
-    RareLabelEncoder(), or set `errors='encode'`.
+    RareLabelEncoder(), or set `unseen='encode'`.
 
     There is a similar implementation in the open-source package
     `Category encoders <https://contrib.scikit-learn.org/category_encoders/>`_
@@ -127,7 +127,7 @@ class CountFrequencyEncoder(CategoricalInitMixin, CategoricalMethodsMixin):
         encoding_method: str = "count",
         variables: Union[None, int, str, List[Union[str, int]]] = None,
         ignore_format: bool = False,
-        errors: str = "ignore",
+        unseen: str = "ignore",
     ) -> None:
 
         if encoding_method not in ["count", "frequency"]:
@@ -136,10 +136,10 @@ class CountFrequencyEncoder(CategoricalInitMixin, CategoricalMethodsMixin):
                 f"Got {encoding_method} instead."
             )
 
-        check_parameter_errors(errors, ["ignore", "raise", "encode"])
+        check_parameter_unseen(unseen, ["ignore", "raise", "encode"])
         super().__init__(variables, ignore_format)
         self.encoding_method = encoding_method
-        self.errors = errors
+        self.unseen = unseen
 
     def fit(self, X: pd.DataFrame, y: Optional[pd.Series] = None):
         """
@@ -159,7 +159,7 @@ class CountFrequencyEncoder(CategoricalInitMixin, CategoricalMethodsMixin):
         self._get_feature_names_in(X)
 
         self.encoder_dict_ = {}
-        dct_init = defaultdict(lambda: 0) if self.errors == "encode" else {}
+        dct_init = defaultdict(lambda: 0) if self.unseen == "encode" else {}
 
         # learn encoding maps
         for var in self.variables_:
diff --git a/feature_engine/encoding/decision_tree.py b/feature_engine/encoding/decision_tree.py
index e9a957f..eef4ac5 100644
--- a/feature_engine/encoding/decision_tree.py
+++ b/feature_engine/encoding/decision_tree.py
@@ -219,7 +219,7 @@ class DecisionTreeEncoder(CategoricalInitMixin, CategoricalMethodsMixin):
             encoding_method=self.encoding_method,
             variables=self.variables_,
             ignore_format=self.ignore_format,
-            errors="raise",
+            unseen="raise",
         )
 
         # initialize decision tree discretiser
diff --git a/feature_engine/encoding/mean_encoding.py b/feature_engine/encoding/mean_encoding.py
index 40b9ad9..2bafa54 100644
--- a/feature_engine/encoding/mean_encoding.py
+++ b/feature_engine/encoding/mean_encoding.py
@@ -17,7 +17,7 @@ from feature_engine._docstrings.methods import (
 from feature_engine._docstrings.substitute import Substitution
 from feature_engine.dataframe_checks import check_X_y
 from feature_engine.encoding._docstrings import (
-    _errors_docstring,
+    _unseen_docstring,
     _ignore_format_docstring,
     _transform_docstring,
     _variables_docstring,
@@ -31,7 +31,7 @@ from feature_engine.encoding.base_encoder import (
 @Substitution(
     ignore_format=_ignore_format_docstring,
     variables=_variables_docstring,
-    errors=_errors_docstring,
+    unseen=_unseen_docstring,
     variables_=_variables_attribute_docstring,
     feature_names_in_=_feature_names_in_docstring,
     n_features_in_=_n_features_in_docstring,
@@ -68,7 +68,7 @@ class MeanEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
 
     {ignore_format}
 
-    {errors}
+    {unseen}
 
     Attributes
     ----------
@@ -118,10 +118,10 @@ class MeanEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
         self,
         variables: Union[None, int, str, List[Union[str, int]]] = None,
         ignore_format: bool = False,
-        errors: str = "ignore",
+        unseen: str = "ignore",
     ) -> None:
 
-        super().__init__(variables, ignore_format, errors)
+        super().__init__(variables, ignore_format, unseen)
 
     def fit(self, X: pd.DataFrame, y: pd.Series):
         """
diff --git a/feature_engine/encoding/ordinal.py b/feature_engine/encoding/ordinal.py
index 5c9069f..8d1008a 100644
--- a/feature_engine/encoding/ordinal.py
+++ b/feature_engine/encoding/ordinal.py
@@ -17,7 +17,7 @@ from feature_engine._docstrings.methods import (
 from feature_engine._docstrings.substitute import Substitution
 from feature_engine.dataframe_checks import check_X, check_X_y
 from feature_engine.encoding._docstrings import (
-    _errors_docstring,
+    _unseen_docstring,
     _ignore_format_docstring,
     _transform_docstring,
     _variables_docstring,
@@ -31,7 +31,7 @@ from feature_engine.encoding.base_encoder import (
 @Substitution(
     ignore_format=_ignore_format_docstring,
     variables=_variables_docstring,
-    errors=_errors_docstring,
+    unseen=_unseen_docstring,
     variables_=_variables_attribute_docstring,
     feature_names_in_=_feature_names_in_docstring,
     n_features_in_=_n_features_in_docstring,
@@ -73,7 +73,7 @@ class OrdinalEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
 
     {ignore_format}
 
-    {errors}
+    {unseen}
 
     Attributes
     ----------
@@ -125,7 +125,7 @@ class OrdinalEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
         encoding_method: str = "ordered",
         variables: Union[None, int, str, List[Union[str, int]]] = None,
         ignore_format: bool = False,
-        errors: str = "ignore",
+        unseen: str = "ignore",
     ) -> None:
 
         if encoding_method not in ["ordered", "arbitrary"]:
@@ -133,7 +133,7 @@ class OrdinalEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
                 "encoding_method takes only values 'ordered' and 'arbitrary'"
             )
 
-        super().__init__(variables, ignore_format, errors)
+        super().__init__(variables, ignore_format, unseen)
 
         self.encoding_method = encoding_method
 
diff --git a/feature_engine/encoding/probability_ratio.py b/feature_engine/encoding/probability_ratio.py
index 6e7a4db..a1cddd1 100644
--- a/feature_engine/encoding/probability_ratio.py
+++ b/feature_engine/encoding/probability_ratio.py
@@ -18,7 +18,7 @@ from feature_engine._docstrings.methods import (
 from feature_engine._docstrings.substitute import Substitution
 from feature_engine.dataframe_checks import check_X_y
 from feature_engine.encoding._docstrings import (
-    _errors_docstring,
+    _unseen_docstring,
     _ignore_format_docstring,
     _transform_docstring,
     _variables_docstring,
@@ -33,7 +33,7 @@ from feature_engine.tags import _return_tags
 @Substitution(
     ignore_format=_ignore_format_docstring,
     variables=_variables_docstring,
-    errors=_errors_docstring,
+    unseen=_unseen_docstring,
     variables_=_variables_attribute_docstring,
     feature_names_in_=_feature_names_in_docstring,
     n_features_in_=_n_features_in_docstring,
@@ -93,7 +93,7 @@ class PRatioEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
 
     {ignore_format}
 
-    {errors}
+    {unseen}
 
     Attributes
     ----------
@@ -133,7 +133,7 @@ class PRatioEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
         encoding_method: str = "ratio",
         variables: Union[None, int, str, List[Union[str, int]]] = None,
         ignore_format: bool = False,
-        errors: str = "ignore",
+        unseen: str = "ignore",
     ) -> None:
 
         if encoding_method not in ["ratio", "log_ratio"]:
@@ -141,7 +141,7 @@ class PRatioEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
                 "encoding_method takes only values 'ratio' and 'log_ratio'"
             )
 
-        super().__init__(variables, ignore_format, errors)
+        super().__init__(variables, ignore_format, unseen)
 
         self.encoding_method = encoding_method
 
diff --git a/feature_engine/encoding/woe.py b/feature_engine/encoding/woe.py
index 11a9098..0e1849d 100644
--- a/feature_engine/encoding/woe.py
+++ b/feature_engine/encoding/woe.py
@@ -18,7 +18,7 @@ from feature_engine._docstrings.methods import (
 from feature_engine._docstrings.substitute import Substitution
 from feature_engine.dataframe_checks import check_X_y
 from feature_engine.encoding._docstrings import (
-    _errors_docstring,
+    _unseen_docstring,
     _ignore_format_docstring,
     _transform_docstring,
     _variables_docstring,
@@ -33,7 +33,7 @@ from feature_engine.tags import _return_tags
 @Substitution(
     ignore_format=_ignore_format_docstring,
     variables=_variables_docstring,
-    errors=_errors_docstring,
+    unseen=_unseen_docstring,
     variables_=_variables_attribute_docstring,
     feature_names_in_=_feature_names_in_docstring,
     n_features_in_=_n_features_in_docstring,
@@ -76,7 +76,7 @@ class WoEEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
 
     {ignore_format}
 
-    {errors}
+    {unseen}
 
     Attributes
     ----------
@@ -123,10 +123,10 @@ class WoEEncoder(CategoricalInitExpandedMixin, CategoricalMethodsMixin):
         self,
         variables: Union[None, int, str, List[Union[str, int]]] = None,
         ignore_format: bool = False,
-        errors: str = "ignore",
+        unseen: str = "ignore",
     ) -> None:
 
-        super().__init__(variables, ignore_format, errors)
+        super().__init__(variables, ignore_format, unseen)
 
     def fit(self, X: pd.DataFrame, y: pd.Series):
         """


Test patch:
diff --git a/tests/test_encoding/test_count_frequency_encoder.py b/tests/test_encoding/test_count_frequency_encoder.py
index f7ede51..d858838 100644
--- a/tests/test_encoding/test_count_frequency_encoder.py
+++ b/tests/test_encoding/test_count_frequency_encoder.py
@@ -122,12 +122,12 @@ def test_error_if_encoding_method_not_permitted_value(enc_method):
 
 def test_warning_when_df_contains_unseen_categories(df_enc, df_enc_rare):
     # dataset to be transformed contains categories not present in
-    # training dataset (unseen categories), errors set to ignore.
+    # training dataset (unseen categories), unseen set to ignore.
 
     msg = "During the encoding, NaN values were introduced in the feature(s) var_A."
 
-    # check for warning when errors equals 'ignore'
-    encoder = CountFrequencyEncoder(errors="ignore")
+    # check for warning when unseen equals 'ignore'
+    encoder = CountFrequencyEncoder(unseen="ignore")
     encoder.fit(df_enc)
     with pytest.warns(UserWarning) as record:
         encoder.transform(df_enc_rare)
@@ -140,37 +140,37 @@ def test_warning_when_df_contains_unseen_categories(df_enc, df_enc_rare):
 
 def test_error_when_df_contains_unseen_categories(df_enc, df_enc_rare):
     # dataset to be transformed contains categories not present in
-    # training dataset (unseen categories), errors set to raise.
+    # training dataset (unseen categories), unseen set to raise.
 
     msg = "During the encoding, NaN values were introduced in the feature(s) var_A."
 
-    encoder = CountFrequencyEncoder(errors="raise")
+    encoder = CountFrequencyEncoder(unseen="raise")
     encoder.fit(df_enc)
 
-    # check for exception when errors equals 'raise'
+    # check for exception when unseen equals 'raise'
     with pytest.raises(ValueError) as record:
         encoder.transform(df_enc_rare)
 
     # check that the error message matches
     assert str(record.value) == msg
 
-    # check for no error and no warning when errors equals 'encode'
+    # check for no error and no warning when unseen equals 'encode'
     with warnings.catch_warnings():
         warnings.simplefilter("error")
-        encoder = CountFrequencyEncoder(errors="encode")
+        encoder = CountFrequencyEncoder(unseen="encode")
         encoder.fit(df_enc)
         encoder.transform(df_enc_rare)
 
 
-def test_no_error_triggered_when_df_contains_unseen_categories_and_errors_is_encode(
+def test_no_error_triggered_when_df_contains_unseen_categories_and_unseen_is_encode(
     df_enc, df_enc_rare
 ):
     # dataset to be transformed contains categories not present in
     # training dataset (unseen categories).
 
-    # check for no error and no warning when errors equals 'encode'
+    # check for no error and no warning when unseen equals 'encode'
     warnings.simplefilter("error")
-    encoder = CountFrequencyEncoder(errors="encode")
+    encoder = CountFrequencyEncoder(unseen="encode")
     encoder.fit(df_enc)
     with warnings.catch_warnings():
         encoder.transform(df_enc_rare)
@@ -179,7 +179,7 @@ def test_no_error_triggered_when_df_contains_unseen_categories_and_errors_is_enc
 @pytest.mark.parametrize("errors", ["raise", "ignore", "encode"])
 def test_fit_raises_error_if_df_contains_na(errors, df_enc_na):
     # test case 4: when dataset contains na, fit method
-    encoder = CountFrequencyEncoder(errors=errors)
+    encoder = CountFrequencyEncoder(unseen=errors)
     with pytest.raises(ValueError):
         encoder.fit(df_enc_na)
 
@@ -187,20 +187,22 @@ def test_fit_raises_error_if_df_contains_na(errors, df_enc_na):
 @pytest.mark.parametrize("errors", ["raise", "ignore", "encode"])
 def test_transform_raises_error_if_df_contains_na(errors, df_enc, df_enc_na):
     # test case 4: when dataset contains na, transform method
-    encoder = CountFrequencyEncoder(errors=errors)
+    encoder = CountFrequencyEncoder(unseen=errors)
     encoder.fit(df_enc)
     with pytest.raises(ValueError):
         encoder.transform(df_enc_na)
 
 
 def test_zero_encoding_for_new_categories():
+
     df_fit = pd.DataFrame(
         {"col1": ["a", "a", "b", "a", "c"], "col2": ["1", "2", "3", "1", "2"]}
     )
     df_transf = pd.DataFrame(
         {"col1": ["a", "d", "b", "a", "c"], "col2": ["1", "2", "3", "1", "4"]}
     )
-    encoder = CountFrequencyEncoder(errors="encode").fit(df_fit)
+    encoder = CountFrequencyEncoder(unseen="encode").fit(df_fit)
+
     result = encoder.transform(df_transf)
 
     # check that no NaNs are added
@@ -211,7 +213,7 @@ def test_zero_encoding_for_new_categories():
     pd.testing.assert_frame_equal(result, expected_result)
 
 
-def test_zero_encoding_for_unseen_categories_if_errors_is_encode():
+def test_zero_encoding_for_unseen_categories_if_unseen_is_encode():
     df_fit = pd.DataFrame(
         {"col1": ["a", "a", "b", "a", "c"], "col2": ["1", "2", "3", "1", "2"]}
     )
@@ -220,7 +222,7 @@ def test_zero_encoding_for_unseen_categories_if_errors_is_encode():
     )
 
     # count encoding
-    encoder = CountFrequencyEncoder(errors="encode").fit(df_fit)
+    encoder = CountFrequencyEncoder(unseen="encode").fit(df_fit)
     result = encoder.transform(df_transform)
 
     # check that no NaNs are added
@@ -231,7 +233,7 @@ def test_zero_encoding_for_unseen_categories_if_errors_is_encode():
     pd.testing.assert_frame_equal(result, expected_result)
 
     # with frequency
-    encoder = CountFrequencyEncoder(encoding_method="frequency", errors="encode").fit(
+    encoder = CountFrequencyEncoder(encoding_method="frequency", unseen="encode").fit(
         df_fit
     )
     result = encoder.transform(df_transform)
@@ -246,14 +248,14 @@ def test_zero_encoding_for_unseen_categories_if_errors_is_encode():
     pd.testing.assert_frame_equal(result, expected_result)
 
 
-def test_nan_encoding_for_new_categories_if_errors_is_ignore():
+def test_nan_encoding_for_new_categories_if_unseen_is_ignore():
     df_fit = pd.DataFrame(
         {"col1": ["a", "a", "b", "a", "c"], "col2": ["1", "2", "3", "1", "2"]}
     )
     df_transf = pd.DataFrame(
         {"col1": ["a", "d", "b", "a", "c"], "col2": ["1", "2", "3", "1", "4"]}
     )
-    encoder = CountFrequencyEncoder(errors="ignore").fit(df_fit)
+    encoder = CountFrequencyEncoder(unseen="ignore").fit(df_fit)
     result = encoder.transform(df_transf)
 
     # check that no NaNs are added
@@ -358,6 +360,6 @@ def test_variables_cast_as_category(df_enc_category_dtypes):
 
 
 @pytest.mark.parametrize("errors", ["empanada", False, 1])
-def test_exception_if_errors_gets_not_permitted_value(errors):
+def test_exception_if_unseen_gets_not_permitted_value(errors):
     with pytest.raises(ValueError):
-        CountFrequencyEncoder(errors=errors)
+        CountFrequencyEncoder(unseen=errors)
diff --git a/tests/test_encoding/test_mean_encoder.py b/tests/test_encoding/test_mean_encoder.py
index eeef329..2e5d9f5 100644
--- a/tests/test_encoding/test_mean_encoder.py
+++ b/tests/test_encoding/test_mean_encoder.py
@@ -123,7 +123,7 @@ def test_warning_if_transform_df_contains_categories_not_present_in_fit_df(
 
     # check for warning when rare_labels equals 'ignore'
     with pytest.warns(UserWarning) as record:
-        encoder = MeanEncoder(errors="ignore")
+        encoder = MeanEncoder(unseen="ignore")
         encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"])
         encoder.transform(df_enc_rare[["var_A", "var_B"]])
 
@@ -134,7 +134,7 @@ def test_warning_if_transform_df_contains_categories_not_present_in_fit_df(
 
     # check for error when rare_labels equals 'raise'
     with pytest.raises(ValueError) as record:
-        encoder = MeanEncoder(errors="raise")
+        encoder = MeanEncoder(unseen="raise")
         encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"])
         encoder.transform(df_enc_rare[["var_A", "var_B"]])
 
@@ -301,4 +301,4 @@ def test_variables_cast_as_category(df_enc_category_dtypes):
 
 def test_error_if_rare_labels_not_permitted_value():
     with pytest.raises(ValueError):
-        MeanEncoder(errors="empanada")
+        MeanEncoder(unseen="empanada")
diff --git a/tests/test_encoding/test_ordinal_encoder.py b/tests/test_encoding/test_ordinal_encoder.py
index 1286e78..48e39ff 100644
--- a/tests/test_encoding/test_ordinal_encoder.py
+++ b/tests/test_encoding/test_ordinal_encoder.py
@@ -70,7 +70,7 @@ def test_error_if_input_df_contains_categories_not_present_in_training_df(
 
     # check for warning when rare_labels equals 'ignore'
     with pytest.warns(UserWarning) as record:
-        encoder = OrdinalEncoder(errors="ignore")
+        encoder = OrdinalEncoder(unseen="ignore")
         encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"])
         encoder.transform(df_enc_rare[["var_A", "var_B"]])
 
@@ -81,7 +81,7 @@ def test_error_if_input_df_contains_categories_not_present_in_training_df(
 
     # check for error when rare_labels equals 'raise'
     with pytest.raises(ValueError) as record:
-        encoder = OrdinalEncoder(errors="raise")
+        encoder = OrdinalEncoder(unseen="raise")
         encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"])
         encoder.transform(df_enc_rare[["var_A", "var_B"]])
 
@@ -170,4 +170,4 @@ def test_variables_cast_as_category(df_enc_category_dtypes):
 
 def test_error_if_rare_labels_not_permitted_value():
     with pytest.raises(ValueError):
-        OrdinalEncoder(errors="empanada")
+        OrdinalEncoder(unseen="empanada")
diff --git a/tests/test_encoding/test_probability_ratio_encoder.py b/tests/test_encoding/test_probability_ratio_encoder.py
index 5c4a24b..b76dfec 100644
--- a/tests/test_encoding/test_probability_ratio_encoder.py
+++ b/tests/test_encoding/test_probability_ratio_encoder.py
@@ -254,7 +254,7 @@ def test_warn_if_transform_df_contains_categories_not_seen_in_fit(df_enc, df_enc
 
     # check for warning when rare_labels equals 'ignore'
     with pytest.warns(UserWarning) as record:
-        encoder = PRatioEncoder(errors="ignore")
+        encoder = PRatioEncoder(unseen="ignore")
         encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"])
         encoder.transform(df_enc_rare[["var_A", "var_B"]])
 
@@ -265,7 +265,7 @@ def test_warn_if_transform_df_contains_categories_not_seen_in_fit(df_enc, df_enc
 
     # check for error when rare_labels equals 'raise'
     with pytest.raises(ValueError) as record:
-        encoder = PRatioEncoder(errors="raise")
+        encoder = PRatioEncoder(unseen="raise")
         encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"])
         encoder.transform(df_enc_rare[["var_A", "var_B"]])
 
@@ -275,4 +275,4 @@ def test_warn_if_transform_df_contains_categories_not_seen_in_fit(df_enc, df_enc
 
 def test_error_if_rare_labels_not_permitted_value():
     with pytest.raises(ValueError):
-        PRatioEncoder(errors="empanada")
+        PRatioEncoder(unseen="empanada")
diff --git a/tests/test_encoding/test_woe_encoder.py b/tests/test_encoding/test_woe_encoder.py
index 3ed5da5..f738663 100644
--- a/tests/test_encoding/test_woe_encoder.py
+++ b/tests/test_encoding/test_woe_encoder.py
@@ -141,7 +141,7 @@ def test_warn_if_transform_df_contains_categories_not_seen_in_fit(df_enc, df_enc
 
     # check for error when rare_labels equals 'raise'
     with pytest.warns(UserWarning) as record:
-        encoder = WoEEncoder(errors="ignore")
+        encoder = WoEEncoder(unseen="ignore")
         encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"])
         encoder.transform(df_enc_rare[["var_A", "var_B"]])
 
@@ -152,7 +152,7 @@ def test_warn_if_transform_df_contains_categories_not_seen_in_fit(df_enc, df_enc
 
     # check for error when rare_labels equals 'raise'
     with pytest.raises(ValueError) as record:
-        encoder = WoEEncoder(errors="raise")
+        encoder = WoEEncoder(unseen="raise")
         encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"])
         encoder.transform(df_enc_rare[["var_A", "var_B"]])
 
@@ -268,4 +268,4 @@ def test_variables_cast_as_category(df_enc_category_dtypes):
 
 def test_error_if_rare_labels_not_permitted_value():
     with pytest.raises(ValueError):
-        WoEEncoder(errors="empanada")
+        WoEEncoder(unseen="empanada")