There are two phases in kNN algorithm, namelyoffline phase and online phase. Deployment of kNN algorithm for indoor location sensing requires a predefined database or radio map.
The radio map is built from the received signal strength (RSS) of two or more local wireless access points (APs) during the offline phase.
During offline phase, reference points (RPs) are selected on a sample floor map. At each RP, reading of RSS values are collected over a period of time. RSS values from all APs are collected at each RP. This process is repeated at another RP until all the RPsare visited. The offline fingerprint vectors are noted as ki (k1, k2, k3…).