update takeSamples() function and allow to take smaller amount of samples involving all possible levels of each factor in training data.