A k-nearest neighbors approach to the design of radar detectors