How to get answer on DecisionForests?

Hello, I have read article on Decision Forests here - Introducing TensorFlow Decision Forests — The TensorFlow Blog . However, it is not clear to me how to get an asnwer what is the guessed “species” when I provide other attributes. The article ends with model evaluation and statistics, but does not show how to actually use it. Thanks very much, Jan

Hi Jan,

TF-DF models, like the model in this Blog post, are a Keras model. See the Keras model documentation for details on how to use them. Informally, here are how predictions can be generated:

#1: Predict
Calling model.predict(dataset). The argument need to be the same (or compatible) as the datasets provided for training or testing. For example:

model.predict(test_ds)

This solution is demonstrated in the Inspect and debug tutorial.

#2: Call

Calling model(examples_tensor). Here, examples_tensor can be a batch of examples or the output of another model. This solution is shown in the composition tutorial.

Note that when calling a model right after training, tensor types will be converted automatically if necessary (for example, the model expects an int32 tensor by the example contain float32 values). However, when calling a model loaded from disk, this automatic conversion is not applied.

##3: Yggdrasil decision forests’s predict

Using the Yggdrasil C++ API to generate predictions. See documentation here and here.