digit prediction based on class averages