PurpleAir assigns the rating. They do not appear to have documented how it is calculated. However, based on this thread about WiFi Status Indicators, I suspect they are comparing the user reported location to a location associated with the public IP address assigned to the sensor.