add function to generate training sets from data
add basic tests for trainingSet