preprocessing generates training dataset