The SATVAM (Streaming Analytics over Temporal Variables from Air quality Monitoring) initiative has been developing low-cost air quality (LCAQ) sensor networks based on highly portable IoT software platforms. These LCAQ devices include PM2.5 as well as gas sensors. A unique feature of this low-cost sensor deployment was a swap-out experiment wherein four of the six sensors were relocated to different sites in the two phases. The swap-out experiment was crucial in investigating the efficacy of calibration models when applied to weather and air quality conditions vastly different from those present during calibration. A novel local calibration algorithm was developed based on metric learning that offers stable and accurate calibration performance.