fix pred calculating in tree.cpp