Skip to content

Commit b3c213b

Browse files
DOC update KNNImputer metric parameter by describing the expected interface when passing a callable (scikit-learn#29776)
Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai>
1 parent 6d9d09a commit b3c213b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sklearn/impute/_knn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ class KNNImputer(_BaseImputer):
5555
5656
- 'nan_euclidean'
5757
- callable : a user-defined function which conforms to the definition
58-
of ``_pairwise_callable(X, Y, metric, **kwds)``. The function
59-
accepts two arrays, X and Y, and a `missing_values` keyword in
60-
`kwds` and returns a scalar distance value.
58+
of ``func_metric(x, y, *, missing_values=np.nan)``. `x` and `y`
59+
corresponds to a row (i.e. 1-D arrays) of `X` and `Y`, respectively.
60+
The callable should returns a scalar distance value.
6161
6262
copy : bool, default=True
6363
If True, a copy of X will be created. If False, imputation will

0 commit comments

Comments
 (0)