Data-driven estimation of the invisible energy of cosmic ray showers with the Pierre Auger Observatory