KNearestNeighborsImputer¶
The KNearestNeighborsImputer replaces missing values in given Columns with the mean value of the K-nearest neighbors.
Parent type: TableTransformer
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
neighborCount |
Int |
The number of neighbors to consider when imputing missing values. | - |
selector |
union<List<String>, String?> |
The list of columns used to impute missing values. If 'None', all columns are used. | null |
valueToReplace |
union<Float, String?> |
The placeholder for the missing values. All occurrences ofmissing_values will be imputed. |
null |
Stub code in KNearestNeighborsImputer.sdsstub
isFitted¶
Whether the transformer is fitted.
Type: Boolean
neighborCount¶
The number of neighbors to consider when imputing missing values.
Type: Int
valueToReplace¶
The value to replace.
Type: Any?
fit¶
Learn a transformation for a set of columns in a table.
Note: This transformer is not modified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table |
Table |
The table used to fit the transformer. | - |
Results:
| Name | Type | Description |
|---|---|---|
fittedTransformer |
KNearestNeighborsImputer |
The fitted transformer. |
Stub code in KNearestNeighborsImputer.sdsstub
fitAndTransform¶
Learn a transformation for a set of columns in a table and apply the learned transformation to the same table.
Note: Neither this transformer nor the given table are modified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table |
Table |
The table used to fit the transformer. The transformer is then applied to this table. | - |
Results:
| Name | Type | Description |
|---|---|---|
fittedTransformer |
KNearestNeighborsImputer |
The fitted transformer. |
transformedTable |
Table |
The transformed table. |
Stub code in KNearestNeighborsImputer.sdsstub
transform¶
Apply the learned transformation to a table.
Note: The given table is not modified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table |
Table |
The table to which the learned transformation is applied. | - |
Results:
| Name | Type | Description |
|---|---|---|
transformedTable |
Table |
The transformed table. |