A controller for controlling the operation of a breathing assistance device that provides breathing assistance to a user, wherein the controller comprises: an input for receiving sensor data to measure at least one airflow parameter of the user's airflow; a memory unit that comprises software instructions and parameters for at least one machine learning model and a sleep disruption severity predictor; and a processor that is electronically coupled to the input to receive the sensor data, the processor being configured to perform measurements and to generate a control signal for controlling the breathing assistance device for a current monitoring time period by: obtaining, from the sensor data, measured air pressure data, measured airflow data or both the measured air pressure data and the measured airflow data during the current monitoring time period when the user is using the breathing assistance device; performing feature extraction on the measured air pressure data, the measured airflow data or both the measured air pressure data and the measured airflow data to obtain feature values; applying a predictive sleep disruption severity machine learning model of the at least one machine learning model to the feature values, the predictive sleep disruption severity machine learning model employed by the sleep disruption severity predictor to determine a predicted sleep disruption severity index for the user to predict a severity of an upcoming sleep disruption event; and adjusting the control signal of the breathing assistance device based on at least the predicted sleep disruption severity index. an input for receiving sensor data to measure at least one airflow parameter of the user's airflow; a memory unit that comprises software instructions and parameters for at least one machine learning model and a sleep disruption severity predictor; and a processor that is electronically coupled to the input to receive the sensor data, the processor being configured to perform measurements and to generate a control signal for controlling the breathing assistance device for a current monitoring time period by: obtaining, from the sensor data, measured air pressure data, measured airflow data or both the measured air pressure data and the measured airflow data during the current monitoring time period when the user is using the breathing assistance device; performing feature extraction on the measured air pressure data, the measured airflow data or both the measured air pressure data and the measured airflow data to obtain feature values; applying a predictive sleep disruption severity machine learning model of the at least one machine learning model to the feature values, the predictive sleep disruption severity machine learning model employed by the sleep disruption severity predictor to determine a predicted sleep disruption severity index for the user to predict a severity of an upcoming sleep disruption event; and adjusting the control signal of the breathing assistance device based on at least the predicted sleep disruption severity index. obtaining, from the sensor data, measured air pressure data, measured airflow data or both the measured air pressure data and the measured airflow data during the current monitoring time period when the user is using the breathing assistance device; performing feature extraction on the measured air pressure data, the measured airflow data or both the measured air pressure data and the measured airflow data to obtain feature values; applying a predictive sleep disruption severity machine learning model of the at least one machine learning model to the feature values, the predictive sleep disruption severity machine learning model employed by the sleep disruption severity predictor to determine a predicted sleep disruption severity index for the user to predict a severity of an upcoming sleep disruption event; and adjusting the control signal of the breathing assistance device based on at least the predicted sleep disruption severity index.