Development of an automated system for obstructive sleep apnea treatment based on machine learning and breath effort monitoring