Fig 3 - Code Segment for creating training and test data