Open leandroimail opened 2 years ago
It should be something similar to the following:
auto_model.tuner.hyper_pipeline.outputs[0].preprocessor.labels
It corresponds to this attribute: https://github.com/keras-team/autokeras/blob/8e128ca7f9ca6f9efb7276be0262c53bd4b279ed/autokeras/preprocessors/encoders.py#L30 It should be a list of strings corresponding the class labels of the probabilities. Please let me know if it works. We may have a more elegent way to get this information in the future.
@haifeng-jin , thank you for your help.
Almost worked your solution. I had to add another level of the index array like the following code:
auto_model.tuner.hyper_pipeline.outputs[0][0].preprocessor.labels
When you make a more elegant way to fix this problem, please, let me know.
Thank again for your help.
I have a problem with a multiclass predict model.
I make my custom Automodel with an automatic categorical_encoding like the follow code:
when I use the model to predict I get an array of probabilities, but I don't know which position in the array refers to each class of my target.
y_prob = self.model.predict(test_features)
the result is an array of array, for example:
[0.18029907, 0.41025335, 0.40944752]
In this example, I used Iris dataframe to test.
But, How do I know if the zero position of my probability array is an Iris-verginica, Iris-setosa or an Iris-visicolor?
Where can I get the relation of the position of the array with the name of each class?