OS-2357 use addAll to modify trainingData instead of add because writes are expensive