Flow
sklearn.impute._knn.KNNImputer

sklearn.impute._knn.KNNImputer

Visibility: public Uploaded 01-07-2023 by Luís Miguel Matos sklearn==1.3.0 numpy>=1.17.3 scipy>=1.5.0 joblib>=1.1.1 threadpoolctl>=2.0.0 0 runs
0 likes downloaded by 0 people 0 issues 0 downvotes , 0 total downloads
  • openml-python python scikit-learn sklearn sklearn_1.3.0
Issue #Downvotes for this reason By


Loading wiki
Help us complete this description Edit
Imputation for completing missing values using k-Nearest Neighbors. Each sample's missing values are imputed using the mean value from `n_neighbors` nearest neighbors found in the training set. Two samples are close if the features that neither is missing are close.

Parameters

add_indicatorIf True, a :class:`MissingIndicator` transform will stack onto the output of the imputer's transform. This allows a predictive estimator to account for missingness despite imputation. If a feature has no missing values at fit/train time, the feature won't appear on the missing indicator even if there are missing values at transform/test timedefault: false
copyIf True, a copy of X will be created. If False, imputation will be done in-place whenever possibledefault: true
keep_empty_featuresIf True, features that consist exclusively of missing values when `fit` is called are returned in results when `transform` is called The imputed value is always `0` .. versionadded:: 1.2default: false
metricdefault: "nan_euclidean"
missing_valuesThe placeholder for the missing values. All occurrences of `missing_values` will be imputed. For pandas' dataframes with nullable integer dtypes with missing values, `missing_values` should be set to np.nan, since `pd.NA` will be converted to np.nandefault: NaN
n_neighborsNumber of neighboring samples to use for imputation weights : {'uniform', 'distance'} or callable, default='uniform' Weight function used in prediction. Possible values: - 'uniform' : uniform weights. All points in each neighborhood are weighted equally - 'distance' : weight points by the inverse of their distance in this case, closer neighbors of a query point will have a greater influence than neighbors which are further awaydefault: 5
weightsdefault: "uniform"

0
Runs

List all runs
Parameter:
Rendering chart
Rendering table