add class trajectory based on DataFrame