add greedy selection for both training and testing data