- The paper presents WARNN, an innovative algorithm that dynamically assigns adaptive radii to training samples for improved WiFi positioning accuracy and reliable outlier rejection.
- It employs an inverse distance weighting scheme with adaptive decay to enhance neighbor influence based on relative positioning within heterogeneous spatial data.
- Experimental evaluation on 22 datasets shows WARNN reduces average 3D positioning error by up to 3% compared to top kNN variants, highlighting its robustness and precision.
(Weighted) Adaptive Radius Near Neighbor Search for WiFi Fingerprint Positioning
Introduction and Motivation
WiFi fingerprint-based positioning continues to leverage non-parametric methods, predominantly k-Nearest Neighbors (kNN), due to its adaptability across diverse deployment environments. However, kNN’s methodology of leveraging a fixed number of neighbors, regardless of spatial distribution or data density, often results in suboptimal label assignments, especially in regions with heterogeneously distributed samples. Fixed Radius Near Neighbor (FRNN) methods, which select neighbors based on a predefined distance threshold, address some limitations but introduce new challenges, particularly the selection of a suitable fixed radius (rmax) across varying density landscapes. As wireless fingerprint collections grow in scale and heterogeneity, adaptive neighborhood selection mechanisms become increasingly necessary.
This paper introduces two substantial extensions: the Adaptive Radius Near Neighbor (ARNN) and its weighted variant WARNN. Both methods dynamically tailor neighborhood selection parameters, with WARNN further integrating a distance-weighted aggregation scheme sensitive to both absolute and relative proximity within adaptive radii.
Algorithmic Innovations
Adaptive Radius Near Neighbor (ARNN)
The ARNN algorithm departs from fixed neighborhood definitions by assigning every training sample an individually optimized radius ri. During training, ARNN computes, for each yi, the largest radius for which its k nearest neighbors yield an error within a threshold τϵ. The method systematically sweeps k from Kmin to k0, thus capturing spatial variations in data density and optimizing local generalization capability. For test-time inference, ARNN aggregates all training records for which the test point k1 is within the precomputed radius k2. Samples lying outside the union of all training radii yield no prediction, which is preferable to forced misclassifications in the context of out-of-distribution detection.
Weighted ARNN (WARNN)
While ARNN delivers adaptive coverage, it fails to account for heterogeneity in neighbor informativeness. WARNN introduces an inverse distance weighting schema with an adaptive decay factor:
- The weight assigned to training sample k3 for a query k4 is
k5
where
k6
- This formulation incorporates not just absolute distance but the relative position of k7 within k8’s neighborhood, improving the granularity of influence allocation, especially near adaptive neighborhood boundaries.

Figure 1: Illustration of the challenge in choosing suitable weights in WARNN—showing how relative positioning within an adaptive radius alters sample influence.
This dynamic weighting mitigates the risk of spurious influence from weakly associated neighbors (e.g., near the edge of large radii), ensuring that central, high-confidence neighbors exert dominant influence over the regression or classification outcome.
Experimental Design
The evaluation utilized 22 publicly available WiFi fingerprint datasets, encompassing benchmarks with considerable diversity in spatial layout, access point density, and RSSI noise characteristics. A total of 25 algorithms, including 13 k9NN variants, three FRNN, three ARNN, and six WARNN configurations (spanning distance metrics and weighting options), were subjected to identical cross-validation pipelines. The primary performance indicator was three-dimensional (3D) positioning error, with supplementary attention paid to the “coverage ratio”—the fraction of queries for which an algorithm could return a valid estimate.
All RNN variants enforced a minimum coverage ratio of 90%, ensuring fair comparison with traditional k0NN approaches that always return a prediction.
Results and Analysis
WARNN dramatically outperformed both FRNN and ARNN, and frequently surpassed all tested k1NN variants in average 3D positioning error. Its strongest instantiation (Cityblock distance, adaptive decay; k2) led all approaches:
- WARNN k3 achieved an average 3D positioning error of 4.23 m, 3.0% lower than the best k4NN variant.
- All WARNN configurations clustered closely (error within 3.4% of best k5NN), demonstrating strong robustness to hyperparameter and metric choices.
- FRNN methods, in contrast, suffered substantial degradation (up to 36% higher error) due to inability to accommodate non-uniform spatial densities.

Figure 2: 3D average positioning errors and corresponding coverage ratios of k6 as the training-phase error threshold k7 varies.
Increasing the training error threshold k8 led, somewhat counter-intuitively, to both improved mean positioning error and increased coverage for WARNN. The best average error (4.05 m, 95.8% coverage) was obtained by tuning k9 per dataset.
Notably, the coverage ratio for WARNN variants routinely exceeded 95%, and their performance was largely insensitive to both the choice of distance metric (Cityblock, Euclidean, Cosine) and weighting scheme, provided adaptive decay was employed.
Additional findings:
- ARNN, lacking weighting, was on par with the majority of rmax0NN variants but did not yield further improvements.
- WARNN’s weighting mechanism was crucial for shrinking the performance gap below rmax1NN and, in many cases, surpassing it.
- Adopting dataset-specific error thresholds in WARNN’s training phase can further reduce mean error across the evaluation suite.
Implications and Future Directions
The paper concretely demonstrates that adaptive, radius-based neighbor selection, when combined with distance-aware weighting, yields substantial performance improvements for WiFi fingerprinting regression. These results highlight several implications:
- Practical Implications: WARNN is recommended for offline positioning solutions where slight increase in training-time computational complexity is permissible. The modest cost is repaid by gains in predictive precision and reliability, especially where training data is spatially heterogeneous or boundaries extend into open/unmapped regions.
- Radius-based approaches can gracefully reject out-of-distribution queries, a critical property for deployment in public and unsupervised environments.
- Adaptive weight decay ensures neighborhood relevance even as radius varies, solving persistent challenges linked to both FRNN and rmax2NN weighting.
Theoretically, this work motivates a reassessment of static neighborhood definitions in high-dimensional regression and classification. The relative insensitivity of WARNN to hyperparameters suggests a promising default for practitioners seeking robust, generalizable positioning models.
Future research avenues include:
- Acceleration strategies for ARNN and WARNN training, particularly for large-scale or continually updated databases.
- Generalization of WARNN to other regression and classification tasks beyond WiFi fingerprinting, including BLE, UWB, or even non-localization contexts.
- Enhanced outlier detection: Experiments with test samples absent from the training domain could further validate radius-based rejection and inform deployment in safety-critical applications.
- Advanced parameter optimization: Automating the tuning of rmax3 and other hyperparameters, potentially with meta-learning or Bayesian optimization, to guarantee optimality across heterogeneous datasets.
Conclusion
The (Weighted) Adaptive Radius Near Neighbor framework addresses key limitations inherent to classical rmax4NN and FRNN approaches in WiFi fingerprint-based positioning. By integrating adaptive, point-wise neighborhood selection with distance-dependent weighting, WARNN consistently outperformed both FRNN and state-of-the-art rmax5NN variants across a comprehensive suite of real-world benchmarks. The framework delivers improved predictive accuracy, high coverage, and offers a principled mechanism for out-of-domain detection—solidifying its status as a robust, versatile tool for indoor positioning and related spatial regression applications.