this algo can output the predict result