knn_nas_imp {creditmodel} | R Documentation |
This function is not intended to be used by end user.
knn_nas_imp( dat, x, nas_rate = NULL, mat_nas_shadow = NULL, dt_nas_random = NULL, k = 10, scale = FALSE, method = "median", miss_value_num = -1 )
dat |
A data.frame with independent variables. |
x |
The name of variable to process. |
nas_rate |
A list contains nas rate of each variable. |
mat_nas_shadow |
A shadow matrix of variables which contain nas. |
dt_nas_random |
A data.frame with random nas imputation. |
k |
Number of neighbors of each obs which x is missing. |
scale |
Logical.Standardization of variable. |
method |
The methods of imputation by knn. "median" is knn imputation with k neighbors median, "avg_dist" is knn imputation with k neighbors of distance weighted mean. |
miss_value_num |
Default value of missing data imputation for numeric variables, Defualt is -1. |