Converting label and batch to factors.