We study a missing-value imputation method, termed kNNSampler, that imputes a given unit's missing response by randomly sampling from the observed responses of the most similar units to the given unit in terms of the observed covariates. This method can sample unknown missing values from their distributions, quantify the uncertainties of missing values, and be readily used for multiple imputation. Unlike popular kNNImputer, which estimates the conditional mean of a missing response given an observed covariate, kNNSampler is theoretically shown to estimate the conditional distribution of a missing response given an observed covariate. Experiments demonstrate its effectiveness in recovering the distribution of missing values. The code for kNNSampler is made publicly available: https://github.com/SAP/knn-sampler.
### Changed
- Support per task function(s) priority and worker choice strategy definition via a task function object: { taskFunction: (data?: Data) => Response | Promise<Response>, priority?: number, strategy?: WorkerChoiceStrategy }.
- Add priority queue based tasks queueing. One priority queue is divided into prioritized buckets to avoid queued tasks starvation under load.
- BREAKING CHANGE: listTaskFunctionNames() to listTaskFunctionsProperties() in pool and worker API returning registered task functions properties.
- BREAKING CHANGE: strategy field in pool information renamed to defaultStrategy.
### Fixed
- Ensure worker choice strategy options changes at runtime are propagated to poolifier workers.