New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in yardstick_table()
: ! truth
and estimate
must have the same levels in the same order.
#327
Comments
This is a real user error (not developer error) so it is possible we should un-mark this as an |
I have the same error when I am trying to run these commands below and I put
The error:
For
Yet, it has not worked anyway. Could anyone tell me what I should do? |
Hello @lucasquemelli ! Sorry to hear you are also running into problems. Without being able to see the data, I would recomend that you use truth = factor(y_test_vec, levels = c(0, 1))
estimate = factor(yhat_keras_class_vec, levels = c(0, 1)) If that doesn't fix it, can you show be what happens if you run str(estimates_keras_tbl$estimate)
str(estimates_keras_tbl$truth) |
Perfection! That solved my problem. You are a genius! Thank you so much! |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
I'm doing as I'm told by the yardstick function and posting this issue here.
When using the iris data set, it seems yardstick gets confused because in my code I turn the predicted class into a factor of 1, 2, 3 rather tahn the original character factor (with levels "setosa"...).
So the source of error is clear, but I'm posting it here nonetheless because the function asked me to. So maybe you either want to allow
conf_mat
to work with non-identical factor levels or maybe need to make this "posting request" a bit more tight so that it doesn't pop up for such an issue.This gives error:
And here's the full traceback:
The text was updated successfully, but these errors were encountered: