diff --git a/python/dalex/dalex/model_explanations/_aggregated_profiles/utils.py b/python/dalex/dalex/model_explanations/_aggregated_profiles/utils.py index 4f5e969a4..73a60d3b2 100644 --- a/python/dalex/dalex/model_explanations/_aggregated_profiles/utils.py +++ b/python/dalex/dalex/model_explanations/_aggregated_profiles/utils.py @@ -99,7 +99,7 @@ def split_over_variables_and_labels(split_profile, type, groups, span): def norm(x, loc, scale): - return np.exp(-((x - loc) / scale) ** 2 / 2) / np.pi / np.sqrt(2) / scale + return np.exp(-1 * ((x - loc) / scale) ** 2 / 2) / np.pi / np.sqrt(2) / scale def prepare_numerical_categorical(all_profiles, variables, variable_type): diff --git a/python/dalex/dalex/predict_explanations/_ceteris_paribus/utils.py b/python/dalex/dalex/predict_explanations/_ceteris_paribus/utils.py index 772bafc2c..6f9171019 100644 --- a/python/dalex/dalex/predict_explanations/_ceteris_paribus/utils.py +++ b/python/dalex/dalex/predict_explanations/_ceteris_paribus/utils.py @@ -73,7 +73,11 @@ def calculate_variable_profile(predict_function, profiles = pd.concat(profile) # convert the variable types - profiles.loc[:, list(variable_splits)] = profiles.loc[:, list(variable_splits)].convert_dtypes() + if pd.__version__ >= '1.2.0': + # convert_floating=False since pandas v1.2 seem to have issues + profiles.loc[:, list(variable_splits)] = profiles.loc[:, list(variable_splits)].convert_dtypes(convert_floating=False) + else: + profiles.loc[:, list(variable_splits)] = profiles.loc[:, list(variable_splits)].convert_dtypes() return profiles