Quality prediction for batches or large groups of products