Creation of function openTrainingSet