Skip to content

Commit

Permalink
[python] minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hbaniecki committed Sep 27, 2023
1 parent 142c94d commit 2b8a828
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions python/dalex/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
### development

* Fix an error occuring in `predict_profile()` when a DataFrame has MultiIndex in `pandas >= 1.3.0` ([#550](https://github.com/ModelOriented/DALEX/pull/550))
* Fix gaussian `norm()` calculation in `model_profile()` from `pi*sqrt(2)` to `sqrt(2*pi)`
* Potential fix for a warning (future error) between `prepare_numerical_categorical()` and `prepare_x()` with `pandas == 2.1.0`


### v1.6.0 (2023-02-16)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def split_over_variables_and_labels(split_profile, type, groups, span):


def norm(x, loc, scale):
return np.exp(-1 * ((x - loc) / scale) ** 2 / 2) / np.pi / np.sqrt(2) / scale
return np.exp(-1 * ((x - loc) / scale) ** 2 / 2) / np.sqrt(2 * np.pi) / scale


def prepare_numerical_categorical(all_profiles, variables, variable_type):
Expand All @@ -122,7 +122,7 @@ def prepare_numerical_categorical(all_profiles, variables, variable_type):
if vnames.shape[0] == 0:
raise ValueError("There are no numerical variables")

all_profiles['_x_'] = 0
all_profiles['_x_'] = 0.0

else:
vnames = all_variables[~is_numeric]
Expand Down

0 comments on commit 2b8a828

Please sign in to comment.