In recent years, machine learning has been increasingly applied to the area of mental health diagnosis, treatment, support, research, and clinical administration. In particular, using less-invasive wearables combined with the artificial intelligence to monitor, or diagnose the mental diseases has tremendous needs in real practice. To this end, we propose a novel approach for automatic detection of major depressive disorder. Firstly, spontaneous activity physical data are recorded by a watch-type device equipped with an activity monitor. Subsequently, a bag-of-behaviour-words approach is applied to extract higher representations from the raw sensor data in an unsupervised scenario. Finally, a support vector machine is selected as the classifier to make the predictions on screening the major depressive disorder. There are 69 healthy control subjects, and 14 major depressive disorder patients involved in this study. The experimental results demonstrate the effectiveness of the proposed method in a rigorous subject-independent test, which achieves an unweighted average recall at 59.3 % (an accuracy of 66.0 %). This unweighted average recall significantly ( < .05, onetailed -test) outperforms human hand-crafted features with an unweighted average recall at 53.6 % (an accuracy of 61.7 %).