Helpers for building training sets.