An Activity Recognition Algorithm Based on Energy Expenditure Model