Added function which creates trainingInstanceMatrix