Improving activity recognition by segmental pattern mining