Skip to content
Advertisement

how to calculate accuracy based on two lists python?

I have two lists.

JavaScript

How can I calculate accuracy based on these lists?

Advertisement

Answer

JavaScript

This will give you the percentage that were correct – that is, the number correct over the total number. It works by calculating the number that are equal between the two lists then dividing by the total number of labels.

Also note that if you’re not using Python 3, it will have to look like this:

JavaScript

To ensure you get a decimal representation of the number

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement