Measuring and acting on uncertainty in deep neural networks: Selective prediction and calibrating confidence