Can random forest model be converted to tensorflow.js

I’m thinking about training a random_forest model in python using the tensorflow decision forests library. I was wondering if anyone knew if the model could be converted to tensorflow.js.

1 Like

hi @Umair_Malik,

Unfortunately not. But thanks for bringing this up. Actually feel free to add a “feature request” issue in our github repository

This (or a variation, some way of having training and inference in the browser) is a long standing item in our “we would love to do/have it” list!

We cannot commit to it yet, because we have a large list of higher priority items to work on right now. But I’ll post here whenever this changes.

@pyu @lina128 FYI - May be worth syncing with @Jan to discuss options here if also aligns with any of our 2022 goals though probably would need both teams to collaborate for this.

Is there any way to export and run my TensorFlow Decision Forest model within a mobile app? I have explored and found that both tensorflow.js and tflite have no support for TF-DF models but Is there any other way to do the same?


The JavaScript port of Yggdrasil Decision Forests will be released in the next few weeks. With it, users can run TensorFlow Decision Forest model in JS. I’ll update this thread when available.

We are also in exploring support for TF-DF models in TF-JS and TF-Lite. But there is no timeline here.


Thank you @Mathieu that is really useful to know. Is this standalone JS or builds upon TFJS? I am not familiar with this port?


This port will be released in However, it is not yet public.

This port is independent from TF-JS. Instead, it is a direct call to Yggdrasil Decision Forests using web-assembly.