fix in weighted sample prediction