fixes for CV with rare classes: separated out creation of label dictionaries, added warnings, etc.