1. A method for determining how to deliver and then delivering ventilation to a patient comprising: during a learning period including multiple breath cycles, delivering a fixed degree of support to the patient sufficient to make the patient feel comfortable and measuring the patient's ventilation; selecting a target ventilation for use during the patient's sleep, which target ventilation is just under the ventilation measured during the learning period; and operating a ventilator during a subsequent treatment period by varying the pressure delivered to the patient so that the patient's ventilation is maintained at the selected target ventilation.