Using machine learning in the adaptive control of a smart environment: Master's thesis