How do I convert decision forests prediction results back to original label value?

Hi! I’m a newbie both on ML and TensorFlow. I’ve been trying to educate myself about the Decision Tree Model.

So I’ve followed the Penguin’s species tutorial and later on tried to navigate through the “predictions” sections and so far all I got was an array (see below). But I’ve no clue how should I be able to sort of correlate this floats back to the original species string values that was set as the “label”.

Did I just missed a paragraph about it on the tutorial or this is a genuine beginners questions?

Thank you for the space. Any help is appreciated.

Array return from predictions

[[0.99999917 0.         0.        ]
 [0.98666584 0.         0.01333333]
 [0.99999917 0.         0.        ]
 [0.99999917 0.         0.        ]
 [0.9366659  0.04666667 0.01666667]
 [0.99999917 0.         0.        ]
 [0.99999917 0.         0.        ]
 [0.99999917 0.         0.        ]
 [0.99999917 0.         0.        ]
 [0.99999917 0.         0.        ]]

Hi velvetkeyboard, welcome to the TensorFlow Forum!

TFDF is giving you the probabilities for each class (from 0 to 1)

the classes correlate to the indexes in the classes array:

classes = dataset_df[label].unique().tolist()
print(f"Label classes: {classes}")

>>> Label classes: ['Adelie', 'Gentoo', 'Chinstrap']

so, if one entry from your output is:

[0.98666584 0.         0.01333333]

it means that the first class (probably Adelie) is very likely the correct one

Can you please share the tutorial you followed so I can improve the explanation there too?