add Python predict and R code