Unsupervised Domain Adaptation for Estimating Occupancy and Recognizing Activities in Smart Buildings