Fast Prediction on a Tree