Abstract: Analyzing human behavior in smart environments is an important research area dealing with a multitude of issues related to ubiquitous computing, machine learning and ambient assisted living. With recent advancements in sensing technologies, it is henceforth possible to build computational models that select relevant sensors, and apply statistical models for accurate detection of residents’ activities in smarthomes. To this end, we choose to work with the “Orange4home” dataset which represents one of the latest dataset in this research field. The main contribution of this paper is (1) to perform accurate detection of resident activities (extracted from the “Orange4Home” dataset) by proposing relevant preprocessing and machine learning approaches, and (2) enhance previous classification results already published on the same dataset. Thus, our methodology in this paper is to explore the whole process from data preprocessing to classification metrics. Indeed, a carefully designed and original preprocessing algorithm is proposed in order to properly prepare data to the training phase. Then, to perform relevant exploration of the feature space, many strategies for features selection and reduction (based on Univariate feature selection and Principal Component Analysis) were proposed. For the activities classification task, many well-chosen discriminative models (SVMs, Decision Trees, Random Forests) were explored. Our main results outperform previously published results on the same dataset. Moreover, comparing all proposed classifiers, Random Forests outperform other classifiers and shows that the optimal accuracy rate (95%) was obtained thanks to a smart choice of a limited number of sensors rather the use of the full feature space (i.e. data from all installed sensors). Based on our results, many recommendations (for building optimal smarthomes and activity classification models) were emphasized in the end of this paper.