keep track of train indices for saving categories