diff --git a/src/facet/_types.py b/src/facet/_types.py index 1102a344..61bcd33c 100644 --- a/src/facet/_types.py +++ b/src/facet/_types.py @@ -12,8 +12,8 @@ # a function representing a model to be inspected ModelFunction: TypeAlias = Callable[ - [Union[pd.Series, pd.DataFrame, npt.NDArray[np.float_]]], - Union[pd.Series, npt.NDArray[np.float_], float], + [Union[pd.Series, pd.DataFrame, npt.NDArray[np.float64]]], + Union[pd.Series, npt.NDArray[np.float64], float], ] # a supervised learner in scikit-learn diff --git a/src/facet/data/partition/_partition.py b/src/facet/data/partition/_partition.py index 2c5b34ff..8da833e3 100644 --- a/src/facet/data/partition/_partition.py +++ b/src/facet/data/partition/_partition.py @@ -33,7 +33,7 @@ T_RangePartitioner = TypeVar("T_RangePartitioner", bound="RangePartitioner[Any, Any]") T_CategoryPartitioner = TypeVar("T_CategoryPartitioner", bound="CategoryPartitioner") T_Values = TypeVar("T_Values", bound=np.generic) -T_Values_Numeric = TypeVar("T_Values_Numeric", np.int_, np.float_) +T_Values_Numeric = TypeVar("T_Values_Numeric", np.int_, np.float64) T_Values_Scalar = TypeVar("T_Values_Scalar", int, float) @@ -311,7 +311,7 @@ def _partition_center_offset(self) -> T_Values_Scalar: pass -class ContinuousRangePartitioner(RangePartitioner[np.float_, float]): +class ContinuousRangePartitioner(RangePartitioner[np.float64, float]): """ Partition numerical values in adjacent intervals of the same length. diff --git a/src/facet/explanation/_types.py b/src/facet/explanation/_types.py index 318d9b8b..4c247e05 100644 --- a/src/facet/explanation/_types.py +++ b/src/facet/explanation/_types.py @@ -18,7 +18,7 @@ ArraysAny: TypeAlias = Union[npt.NDArray[Any], List[npt.NDArray[Any]]] -ArraysFloat: TypeAlias = Union[npt.NDArray[np.float_], List[npt.NDArray[np.float_]]] +ArraysFloat: TypeAlias = Union[npt.NDArray[np.float64], List[npt.NDArray[np.float64]]] CatboostPool = catboost.Pool XType: TypeAlias = Union[npt.NDArray[Any], pd.DataFrame, catboost.Pool] YType: TypeAlias = Union[npt.NDArray[Any], pd.Series, None] diff --git a/src/facet/inspection/_inspection.py b/src/facet/inspection/_inspection.py index 6b8bea5d..6228937c 100644 --- a/src/facet/inspection/_inspection.py +++ b/src/facet/inspection/_inspection.py @@ -24,7 +24,7 @@ # Type aliases # -FloatArray: TypeAlias = npt.NDArray[np.float_] +FloatArray: TypeAlias = npt.NDArray[np.float64] # diff --git a/src/facet/inspection/_shap_context.py b/src/facet/inspection/_shap_context.py index 6cbf36bd..bd6752cd 100644 --- a/src/facet/inspection/_shap_context.py +++ b/src/facet/inspection/_shap_context.py @@ -64,9 +64,9 @@ class AffinityMatrix: """ # shape: (2, 2, n_outputs, n_features, n_features) - _matrices: npt.NDArray[np.float_] + _matrices: npt.NDArray[np.float64] - def __init__(self, matrices: npt.NDArray[np.float_]) -> None: + def __init__(self, matrices: npt.NDArray[np.float64]) -> None: shape = matrices.shape assert len(shape) == 5 assert shape[:2] == (2, 2) @@ -76,7 +76,7 @@ def __init__(self, matrices: npt.NDArray[np.float_]) -> None: @staticmethod def from_relative_affinity( - affinity_rel_ij: npt.NDArray[np.float_], std_p_i: npt.NDArray[np.float_] + affinity_rel_ij: npt.NDArray[np.float64], std_p_i: npt.NDArray[np.float64] ) -> AffinityMatrix: """ :param affinity_rel_ij: the affinity matrix from which to create all variations, @@ -125,7 +125,7 @@ def from_relative_affinity( ).reshape((2, 2, *affinity_rel_ij.shape)) ) - def get_values(self, symmetrical: bool, absolute: bool) -> npt.NDArray[np.float_]: + def get_values(self, symmetrical: bool, absolute: bool) -> npt.NDArray[np.float64]: """ Get the matrix matching the given criteria. :param symmetrical: if ``True``, get the symmetrical version of the matrix @@ -133,7 +133,7 @@ def get_values(self, symmetrical: bool, absolute: bool) -> npt.NDArray[np.float_ :return: the affinity matrix """ return cast( - npt.NDArray[np.float_], self._matrices[int(symmetrical), int(absolute)] + npt.NDArray[np.float64], self._matrices[int(symmetrical), int(absolute)] ) @@ -142,7 +142,7 @@ def get_values(self, symmetrical: bool, absolute: bool) -> npt.NDArray[np.float_ # -def ensure_last_axis_is_fast(array: npt.NDArray[np.float_]) -> npt.NDArray[np.float_]: +def ensure_last_axis_is_fast(array: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]: """ For future implementations, ensure that the last axis of the given array is `fast` to allow for `partial summation`. @@ -159,7 +159,7 @@ def ensure_last_axis_is_fast(array: npt.NDArray[np.float_]) -> npt.NDArray[np.fl return array -def sqrt(array: npt.NDArray[np.float_]) -> npt.NDArray[np.float_]: +def sqrt(array: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]: """ Get the square root of each element in the given array. @@ -174,7 +174,7 @@ def sqrt(array: npt.NDArray[np.float_]) -> npt.NDArray[np.float_]: return np.sqrt(np.clip(array, 0, None)) -def make_symmetric(m: npt.NDArray[np.float_]) -> npt.NDArray[np.float_]: +def make_symmetric(m: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]: """ Enforce matrix symmetry by transposing the `feature x feature` matrix for each output and averaging it with the original matrix. @@ -186,7 +186,7 @@ def make_symmetric(m: npt.NDArray[np.float_]) -> npt.NDArray[np.float_]: return (m + transpose(m)) / 2 -def transpose(m: npt.NDArray[np.float_], ndim: int = 3) -> npt.NDArray[np.float_]: +def transpose(m: npt.NDArray[np.float64], ndim: int = 3) -> npt.NDArray[np.float64]: """ Transpose the `feature x feature` matrix for each output. @@ -206,7 +206,7 @@ def transpose(m: npt.NDArray[np.float_], ndim: int = 3) -> npt.NDArray[np.float_ return m.swapaxes(1, 2) -def diagonal(m: npt.NDArray[np.float_]) -> npt.NDArray[np.float_]: +def diagonal(m: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]: """ Get the diagonal of the `feature x feature` matrix for each output. @@ -219,7 +219,7 @@ def diagonal(m: npt.NDArray[np.float_]) -> npt.NDArray[np.float_]: def fill_diagonal( - m: npt.NDArray[np.float_], value: Union[float, npt.NDArray[np.float_]] + m: npt.NDArray[np.float64], value: Union[float, npt.NDArray[np.float64]] ) -> None: """ In each `feature x feature` matrix for each output, fill the diagonal with the given @@ -240,8 +240,8 @@ def fill_diagonal( def cov( - vectors: npt.NDArray[np.float_], weight: Optional[npt.NDArray[np.float_]] -) -> npt.NDArray[np.float_]: + vectors: npt.NDArray[np.float64], weight: Optional[npt.NDArray[np.float64]] +) -> npt.NDArray[np.float64]: """ Calculate the covariance matrix of pairs of vectors along the observations axis and for each output, assuming all vectors are centered (ยต=0). @@ -267,16 +267,16 @@ def cov( weight_total = weight.sum() return cast( - npt.NDArray[np.float_], + npt.NDArray[np.float64], np.matmul(vectors_weighted, vectors.swapaxes(1, 2)) / weight_total, ) def cov_broadcast( - vector_sequence: npt.NDArray[np.float_], - vector_grid: npt.NDArray[np.float_], - weight: Optional[npt.NDArray[np.float_]], -) -> npt.NDArray[np.float_]: + vector_sequence: npt.NDArray[np.float64], + vector_grid: npt.NDArray[np.float64], + weight: Optional[npt.NDArray[np.float64]], +) -> npt.NDArray[np.float64]: """ Calculate the covariance matrix between a sequence of vectors and a grid of vectors along the observations axis and for each output, assuming all vectors are centered @@ -311,7 +311,7 @@ def cov_broadcast( weight_total = weight.sum() return cast( - npt.NDArray[np.float_], + npt.NDArray[np.float64], np.einsum("...io,...ijo->...ij", vectors_weighted, vector_grid) / weight_total, ) @@ -323,29 +323,29 @@ class ShapContext: #: SHAP vectors #: with shape `(n_outputs, n_features, n_observations)` - p_i: npt.NDArray[np.float_] + p_i: npt.NDArray[np.float64] #: observation weights (optional), #: with shape `(n_observations)` - weight: Optional[npt.NDArray[np.float_]] + weight: Optional[npt.NDArray[np.float64]] #: Covariance matrix for p[i], #: with shape `(n_outputs, n_features, n_features)` - cov_p_i_p_j: npt.NDArray[np.float_] + cov_p_i_p_j: npt.NDArray[np.float64] #: Variances for p[i], #: with shape `(n_outputs, n_features, 1)` - var_p_i: npt.NDArray[np.float_] + var_p_i: npt.NDArray[np.float64] #: SHAP interaction vectors #: with shape `(n_outputs, n_features, n_features, n_observations)` - p_ij: Optional[npt.NDArray[np.float_]] + p_ij: Optional[npt.NDArray[np.float64]] def __init__( self, - p_i: npt.NDArray[np.float_], - p_ij: Optional[npt.NDArray[np.float_]], - weight: Optional[npt.NDArray[np.float_]], + p_i: npt.NDArray[np.float64], + p_ij: Optional[npt.NDArray[np.float64]], + weight: Optional[npt.NDArray[np.float64]], ) -> None: assert p_i.ndim == 3 if weight is not None: @@ -377,7 +377,7 @@ def __init__( ) -> None: shap_values: pd.DataFrame = shap_calculator.shap_values - def _p_i() -> npt.NDArray[np.float_]: + def _p_i() -> npt.NDArray[np.float64]: assert ( shap_calculator.feature_index_ is not None ), ASSERTION__CALCULATOR_IS_FITTED @@ -395,7 +395,7 @@ def _p_i() -> npt.NDArray[np.float_]: ) ) - def _weight() -> Optional[npt.NDArray[np.float_]]: + def _weight() -> Optional[npt.NDArray[np.float64]]: # weights # shape: (n_observations) # return a 1d array of weights that aligns with the observations axis of the @@ -403,7 +403,7 @@ def _weight() -> Optional[npt.NDArray[np.float_]]: if sample_weight is not None: return cast( - npt.NDArray[np.float_], + npt.NDArray[np.float64], sample_weight.loc[shap_values.index.get_level_values(-1)].values, ) else: @@ -440,7 +440,7 @@ def __init__( # shape: (n_observations) # return a 1d array of weights that aligns with the observations axis of the # SHAP values tensor (axis 1) - weight: Optional[npt.NDArray[np.float_]] + weight: Optional[npt.NDArray[np.float64]] if sample_weight is not None: _observation_indices = shap_values.index.get_level_values( @@ -479,8 +479,8 @@ def __init__( @staticmethod def __get_orthogonalized_interaction_vectors( - p_ij: npt.NDArray[np.float_], weight: Optional[npt.NDArray[np.float_]] - ) -> npt.NDArray[np.float_]: + p_ij: npt.NDArray[np.float64], weight: Optional[npt.NDArray[np.float64]] + ) -> npt.NDArray[np.float64]: # p_ij: shape: (n_outputs, n_features, n_features, n_observations) assert p_ij.ndim == 4 diff --git a/src/facet/inspection/_shap_projection.py b/src/facet/inspection/_shap_projection.py index 2d82bef9..c541bf89 100644 --- a/src/facet/inspection/_shap_projection.py +++ b/src/facet/inspection/_shap_projection.py @@ -111,7 +111,7 @@ def fit( # type: ignore[override] return self @fitted_only - def association(self, absolute: bool, symmetrical: bool) -> npt.NDArray[np.float_]: + def association(self, absolute: bool, symmetrical: bool) -> npt.NDArray[np.float64]: """ The association matrix for all feature pairs. @@ -130,7 +130,7 @@ def association(self, absolute: bool, symmetrical: bool) -> npt.NDArray[np.float assert self.association_ is not None return self.association_.get_values(symmetrical=symmetrical, absolute=absolute) - def to_frames(self, matrix: npt.NDArray[np.float_]) -> List[pd.DataFrame]: + def to_frames(self, matrix: npt.NDArray[np.float64]) -> List[pd.DataFrame]: """ Transforms one or more affinity matrices into a list of data frames. @@ -241,7 +241,7 @@ def __init__(self) -> None: self.redundancy_: Optional[AffinityMatrix] = None @fitted_only - def synergy(self, symmetrical: bool, absolute: bool) -> npt.NDArray[np.float_]: + def synergy(self, symmetrical: bool, absolute: bool) -> npt.NDArray[np.float64]: """ The synergy matrix for all feature pairs. @@ -261,7 +261,7 @@ def synergy(self, symmetrical: bool, absolute: bool) -> npt.NDArray[np.float_]: return self.synergy_.get_values(symmetrical=symmetrical, absolute=absolute) @fitted_only - def redundancy(self, symmetrical: bool, absolute: bool) -> npt.NDArray[np.float_]: + def redundancy(self, symmetrical: bool, absolute: bool) -> npt.NDArray[np.float64]: """ The redundancy matrix for all feature pairs. diff --git a/src/facet/inspection/base/_model_inspector.py b/src/facet/inspection/base/_model_inspector.py index 86f3b210..a732d623 100644 --- a/src/facet/inspection/base/_model_inspector.py +++ b/src/facet/inspection/base/_model_inspector.py @@ -49,8 +49,8 @@ # Type aliases # -FloatArray: TypeAlias = npt.NDArray[np.float_] -FloatMatrix: TypeAlias = Matrix[np.float_] +FloatArray: TypeAlias = npt.NDArray[np.float64] +FloatMatrix: TypeAlias = Matrix[np.float64] # diff --git a/src/facet/inspection/shap/_function.py b/src/facet/inspection/shap/_function.py index ec498866..7d0b6c9e 100644 --- a/src/facet/inspection/shap/_function.py +++ b/src/facet/inspection/shap/_function.py @@ -71,7 +71,7 @@ def output_names(self) -> List[str]: def _convert_shap_to_df( self, - raw_shap_tensors: List[npt.NDArray[np.float_]], + raw_shap_tensors: List[npt.NDArray[np.float64]], observation_idx: pd.Index, feature_idx: pd.Index, ) -> List[pd.DataFrame]: diff --git a/src/facet/inspection/shap/_shap.py b/src/facet/inspection/shap/_shap.py index 4a91b676..de2f9104 100644 --- a/src/facet/inspection/shap/_shap.py +++ b/src/facet/inspection/shap/_shap.py @@ -344,7 +344,7 @@ def _calculate_shap( feature_names = self.feature_index_ # calculate the shap values, and ensure the result is a list of arrays - shap_values: List[npt.NDArray[np.float_]] = self._convert_shap_tensors_to_list( + shap_values: List[npt.NDArray[np.float64]] = self._convert_shap_tensors_to_list( shap_tensors=( explainer.shap_interaction_values(X=features) if self.interaction_values @@ -379,10 +379,10 @@ def _calculate_shap( def _convert_shap_tensors_to_list( self, *, - shap_tensors: Union[npt.NDArray[np.float_], List[npt.NDArray[np.float_]]], + shap_tensors: Union[npt.NDArray[np.float64], List[npt.NDArray[np.float64]]], n_outputs: int, - ) -> List[npt.NDArray[np.float_]]: - def _validate_shap_tensor(_t: npt.NDArray[np.float_]) -> None: + ) -> List[npt.NDArray[np.float64]]: + def _validate_shap_tensor(_t: npt.NDArray[np.float64]) -> None: if np.isnan(np.sum(_t)): raise AssertionError( "Output of SHAP explainer includes NaN values. " @@ -409,7 +409,7 @@ def _validate_shap_tensor(_t: npt.NDArray[np.float_]) -> None: @abstractmethod def _convert_shap_to_df( self, - raw_shap_tensors: List[npt.NDArray[np.float_]], + raw_shap_tensors: List[npt.NDArray[np.float64]], observation_idx: pd.Index, feature_idx: pd.Index, ) -> List[pd.DataFrame]: @@ -425,7 +425,7 @@ def _convert_shap_to_df( def _convert_raw_shap_to_df( self, - raw_shap_tensors: List[npt.NDArray[np.float_]], + raw_shap_tensors: List[npt.NDArray[np.float64]], observation_idx: pd.Index, feature_idx: pd.Index, ) -> List[pd.DataFrame]: diff --git a/src/facet/inspection/shap/sklearn/_sklearn.py b/src/facet/inspection/shap/sklearn/_sklearn.py index ea6f1b2f..cbc46e28 100644 --- a/src/facet/inspection/shap/sklearn/_sklearn.py +++ b/src/facet/inspection/shap/sklearn/_sklearn.py @@ -150,7 +150,7 @@ def output_names(self) -> List[str]: def _convert_shap_to_df( self, - raw_shap_tensors: List[npt.NDArray[np.float_]], + raw_shap_tensors: List[npt.NDArray[np.float64]], observation_idx: pd.Index, feature_idx: pd.Index, ) -> List[pd.DataFrame]: @@ -238,9 +238,9 @@ def validate_learner(learner: T_Classifier) -> None: def _convert_shap_tensors_to_list( self, *, - shap_tensors: Union[npt.NDArray[np.float_], List[npt.NDArray[np.float_]]], + shap_tensors: Union[npt.NDArray[np.float64], List[npt.NDArray[np.float64]]], n_outputs: int, - ) -> List[npt.NDArray[np.float_]]: + ) -> List[npt.NDArray[np.float64]]: if n_outputs == 1 and isinstance(shap_tensors, list) and len(shap_tensors) == 2: # in the binary classification case, we will proceed with SHAP values # for class 0 only, since values for class 1 will just be the same @@ -268,7 +268,7 @@ def _convert_shap_tensors_to_list( def _convert_shap_to_df( self, - raw_shap_tensors: List[npt.NDArray[np.float_]], + raw_shap_tensors: List[npt.NDArray[np.float64]], observation_idx: pd.Index, feature_idx: pd.Index, ) -> List[pd.DataFrame]: diff --git a/src/facet/selection/_selection.py b/src/facet/selection/_selection.py index d8e15af8..00c2e56f 100644 --- a/src/facet/selection/_selection.py +++ b/src/facet/selection/_selection.py @@ -400,7 +400,7 @@ def _process(name: str) -> Optional[str]: # add all columns that match any of the pre-defined patterns - cv_results_processed: Dict[str, Tuple[str, npt.NDArray[np.float_]]] = {} + cv_results_processed: Dict[str, Tuple[str, npt.NDArray[np.float64]]] = {} for pattern, repl in self._CV_RESULT_PATTERNS: cv_results_processed.update( diff --git a/test/test/facet/test_inspection.py b/test/test/facet/test_inspection.py index f59a8eb6..2e033e7f 100644 --- a/test/test/facet/test_inspection.py +++ b/test/test/facet/test_inspection.py @@ -271,7 +271,7 @@ def test_model_inspection_classifier_binary( try: association_matrix = cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_association_matrix( clustered=True, symmetrical=True ), @@ -365,7 +365,7 @@ def test_model_inspection_classifier_multi_class( try: synergy_matrix = cast( - List[Matrix[np.float_]], + List[Matrix[np.float64]], iris_inspector_multi_class.feature_synergy_matrix(clustered=False), ) @@ -387,7 +387,7 @@ def test_model_inspection_classifier_multi_class( ) redundancy_matrix = cast( - List[Matrix[np.float_]], + List[Matrix[np.float64]], iris_inspector_multi_class.feature_redundancy_matrix(clustered=False), ) assert_allclose( @@ -408,7 +408,7 @@ def test_model_inspection_classifier_multi_class( ) association_matrix = cast( - List[Matrix[np.float_]], + List[Matrix[np.float64]], iris_inspector_multi_class.feature_association_matrix(clustered=False), ) assert_allclose( @@ -587,7 +587,7 @@ def test_model_inspection_classifier_interaction( try: assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_synergy_matrix( clustered=False, symmetrical=True ), @@ -604,7 +604,7 @@ def test_model_inspection_classifier_interaction( ) assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_synergy_matrix(absolute=True, symmetrical=True), ).values, np.array( @@ -620,7 +620,7 @@ def test_model_inspection_classifier_interaction( assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_synergy_matrix(clustered=True), ).values, np.array( @@ -636,7 +636,7 @@ def test_model_inspection_classifier_interaction( assert_allclose( cast( - Matrix[np.float_], model_inspector.feature_synergy_matrix(absolute=True) + Matrix[np.float64], model_inspector.feature_synergy_matrix(absolute=True) ).values, np.array( [ @@ -651,7 +651,7 @@ def test_model_inspection_classifier_interaction( assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_redundancy_matrix( clustered=False, symmetrical=True ), @@ -668,7 +668,7 @@ def test_model_inspection_classifier_interaction( ) assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_redundancy_matrix( absolute=True, symmetrical=True ), @@ -686,7 +686,7 @@ def test_model_inspection_classifier_interaction( assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_redundancy_matrix(clustered=True), ).values, np.array( @@ -702,7 +702,7 @@ def test_model_inspection_classifier_interaction( assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_redundancy_matrix(absolute=True), ).values, np.array( @@ -718,7 +718,7 @@ def test_model_inspection_classifier_interaction( assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_association_matrix( clustered=False, symmetrical=True ), @@ -736,7 +736,7 @@ def test_model_inspection_classifier_interaction( assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_association_matrix( absolute=True, symmetrical=True ), @@ -754,7 +754,7 @@ def test_model_inspection_classifier_interaction( assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_association_matrix(clustered=True), ).values, np.array( @@ -770,7 +770,7 @@ def test_model_inspection_classifier_interaction( assert_allclose( cast( - Matrix[np.float_], + Matrix[np.float64], model_inspector.feature_association_matrix(absolute=True), ).values, np.array( diff --git a/test/test/facet/test_simulation.py b/test/test/facet/test_simulation.py index 701969cf..d3efb820 100644 --- a/test/test/facet/test_simulation.py +++ b/test/test/facet/test_simulation.py @@ -76,7 +76,7 @@ def test_univariate_target_simulation( partitioner = ContinuousRangePartitioner(max_partitions=10) simulation_result: UnivariateSimulationResult[ - np.float_ + np.float64 ] = target_simulator.simulate_feature( feature_name=parameterized_feature, partitioner=partitioner, @@ -142,7 +142,7 @@ def test_univariate_target_subsample_simulation_80( ) simulation_result: UnivariateSimulationResult[ - np.float_ + np.float64 ] = target_simulator.simulate_feature( feature_name=parameterized_feature, partitioner=partitioner, @@ -207,7 +207,7 @@ def test_univariate_uplift_subsample_simulation_95( ) simulation_result: UnivariateSimulationResult[ - np.float_ + np.float64 ] = target_simulator.simulate_feature( feature_name=parameterized_feature, partitioner=partitioner, @@ -267,7 +267,7 @@ def test_univariate_uplift_simulation( partitioner = ContinuousRangePartitioner(max_partitions=10) simulation_result: UnivariateSimulationResult[ - np.float_ + np.float64 ] = uplift_simulator.simulate_feature( feature_name=parameterized_feature, partitioner=partitioner, @@ -333,7 +333,7 @@ def test_univariate_uplift_subsample_simulation( ) simulation_result: UnivariateSimulationResult[ - np.float_ + np.float64 ] = uplift_simulator.simulate_feature( feature_name=parameterized_feature, partitioner=partitioner ) @@ -400,7 +400,7 @@ def test_univariate_probability_simulation( ) simulation_result: UnivariateSimulationResult[ - np.float_ + np.float64 ] = proba_simulator.simulate_feature( feature_name=parameterized_feature, partitioner=partitioner )