2

We have a random forest model trained in R. Is there a way to load&reuse this model with Python?

Our model is saved as Rdata file and if its needed,it can also be saved with any R package possible.

Thanks.

jiahui zhu
  • 31
  • 3
  • 1
    It's possible to load the data again into Python. Rdata is a bit tricky, see https://stackoverflow.com/q/21288133/279627. You are likely better off storing the data in a different format. However, the actual issue is not transferring the data – it's writing an algorithm in Python that can make sense of the data stored by your random forest algorithm in R. You will likely have to implement this yourself, but of course it's possible. – Sven Marnach May 04 '18 at 10:01
  • Thank you. I'm looking for an easy way, if there is not, I can always train another random forest in python. Just a little sad to tell my friend, we can't use his work. – jiahui zhu May 04 '18 at 13:05
  • 1
    If I may ask, what is the reason to push it to Python? Why not keep it in R? That is, what is the use case and what are you trying to achieve in the end? There might be easier ways to achieve it. – coffeinjunky May 04 '18 at 13:17

0 Answers0