Gravar-mail: Head motion classification using thread-based sensor and machine learning algorithm