match training with test samples by clique