Conversation
jkfitzsimons
left a comment
There was a problem hiding this comment.
This is not a method that is a drop in replacement of SimpleImputer in sklearn with similar interface. It looks like you accidentally submitted rough notes?
|
sorry for this issue , please check now . |
jkfitzsimons
left a comment
There was a problem hiding this comment.
You are using the numpy methods here and should be using the DP versions from this package - should be a small change
diffprivlib/SimpleImputer
Outdated
|
|
||
| def _impute_mean(self, col, missing_col): | ||
| non_missing_values = col[~missing_col] | ||
| col_mean = np.nanmean(non_missing_values) |
There was a problem hiding this comment.
you are using nanmean from numpy... shouldn't you use the dp version from this library ;)
|
|
||
| def _impute_median(self, col, missing_col): | ||
| non_missing_values = col[~missing_col] | ||
| col_median = np.nanmedian(non_missing_values) |
There was a problem hiding this comment.
you are using nanmedian from numpy... shouldn't you use the dp version from this library ;)
| def _impute_median(self, col, missing_col): | ||
| non_missing_values = col[~missing_col] | ||
| col_median = np.nanmedian(non_missing_values) | ||
| sensitivity = np.nanmax(np.abs(non_missing_values - col_median)) |
There was a problem hiding this comment.
you are using nanmax from numpy... shouldn't you use the dp version from this library ;)
diffprivlib/SimpleImputer
Outdated
| elif self.strategy == 'constant': | ||
| self.statistics_ = [self.fill_value] * X.shape[1] | ||
| else: | ||
| self.statistics_ = [np.nanmean(col) if np.issubdtype(col.dtype, np.number) else np.nan for col in X.T] |
There was a problem hiding this comment.
you are using nanmean from numpy... shouldn't you use the dp version from this library ;)
|
Sorry bhaiya , i think there is no nanmax and nanmedium functions in this lib . Can you please check it once . |
added nan medium and updated bounds in quantile function
No description provided.