generate QueryActual tuples; split testing and training data based on a ratio param