diff --git a/feature_engine/selection/drop_psi_features.py b/feature_engine/selection/drop_psi_features.py index 9dab10bc8..8b5cdcbd7 100644 --- a/feature_engine/selection/drop_psi_features.py +++ b/feature_engine/selection/drop_psi_features.py @@ -214,7 +214,7 @@ class DropHighPSIFeatures(BaseSelector): def __init__( self, - split_col: str = None, + split_col: Union[str, None] = None, split_frac: float = 0.5, split_distinct: bool = False, cut_off: Union[None, int, float, datetime.date, List] = None, diff --git a/feature_engine/selection/shuffle_features.py b/feature_engine/selection/shuffle_features.py index b0053aa02..7ea906716 100644 --- a/feature_engine/selection/shuffle_features.py +++ b/feature_engine/selection/shuffle_features.py @@ -138,9 +138,9 @@ def __init__( estimator, scoring: str = "roc_auc", cv=3, - threshold: Union[float, int] = None, + threshold: Union[float, int, None] = None, variables: Variables = None, - random_state: int = None, + random_state: Union[int, None] = None, confirm_variables: bool = False, ): diff --git a/feature_engine/selection/single_feature_performance.py b/feature_engine/selection/single_feature_performance.py index da5308853..d084df1c6 100644 --- a/feature_engine/selection/single_feature_performance.py +++ b/feature_engine/selection/single_feature_performance.py @@ -119,7 +119,7 @@ def __init__( estimator, scoring: str = "roc_auc", cv=3, - threshold: Union[int, float] = None, + threshold: Union[int, float, None] = None, variables: Variables = None, confirm_variables: bool = False, ): diff --git a/feature_engine/selection/target_mean_selection.py b/feature_engine/selection/target_mean_selection.py index e90d013ca..7ded0a620 100644 --- a/feature_engine/selection/target_mean_selection.py +++ b/feature_engine/selection/target_mean_selection.py @@ -175,7 +175,7 @@ def __init__( strategy: str = "equal_width", scoring: str = "roc_auc", cv=3, - threshold: Union[int, float] = None, + threshold: Union[int, float, None] = None, regression: bool = False, confirm_variables: bool = False, ): diff --git a/feature_engine/timeseries/forecasting/expanding_window_features.py b/feature_engine/timeseries/forecasting/expanding_window_features.py index 2da549191..26c005e19 100644 --- a/feature_engine/timeseries/forecasting/expanding_window_features.py +++ b/feature_engine/timeseries/forecasting/expanding_window_features.py @@ -124,7 +124,7 @@ def __init__( min_periods: int | None = None, functions: str | list[str] = "mean", periods: int = 1, - freq: str = None, + freq: str | None = None, sort_index: bool = True, missing_values: str = "raise", drop_original: bool = False, diff --git a/feature_engine/timeseries/forecasting/lag_features.py b/feature_engine/timeseries/forecasting/lag_features.py index 10f633424..7a871dafd 100644 --- a/feature_engine/timeseries/forecasting/lag_features.py +++ b/feature_engine/timeseries/forecasting/lag_features.py @@ -101,7 +101,7 @@ def __init__( self, variables: Union[None, int, str, List[Union[str, int]]] = None, periods: Union[int, List[int]] = 1, - freq: Union[str, List[str]] = None, + freq: Union[str, List[str], None] = None, sort_index: bool = True, missing_values: str = "raise", drop_original: bool = False, diff --git a/feature_engine/timeseries/forecasting/window_features.py b/feature_engine/timeseries/forecasting/window_features.py index b5e5fed06..9207e15a8 100644 --- a/feature_engine/timeseries/forecasting/window_features.py +++ b/feature_engine/timeseries/forecasting/window_features.py @@ -127,10 +127,10 @@ def __init__( self, variables: Union[None, int, str, List[Union[str, int]]] = None, window: Union[str, int, Callable, List[int], List[str]] = 3, - min_periods: int = None, + min_periods: Union[int, None] = None, functions: Union[str, List[str]] = "mean", periods: int = 1, - freq: str = None, + freq: Union[str, None] = None, sort_index: bool = True, missing_values: str = "raise", drop_original: bool = False,