Open salim-hertelli opened 1 year ago
The logic behind the calculation of the accuracy is also wrong. It is possible for the model to predict something more that what is in the target (or the model may also fail to predict some label from the target). This leads to the values not being aligned. example: target: {l1: v1, l2: v2, l3: v3} prediction: {l1: v1', l3, v3'} eventually you will be comparing v3 and v3' which are not necessarily comparable
I found your code in your blog when searching about
donut
and I like the notebook you wrote; However, I have some fixes to suggest.In the
run_prediction
function does not work properly and always uses thetest_sample
variable defined above. I suggest the following changes:to
and
to
the same issue occurs in the next code block. change:
to
This makes the result wrong. Because of the problem mentioned above, the function run_prediction will always return the same target and prediction (because it was ignoring the argument
sample
) and basically the 75% accuracy you got is the accuracy for just one sample (which is the test sample you defined earlier)