On 9 May 2016 9:47 pm, "Shishir Pandey" <shishir...@gmail.com> wrote:
>
> From what you are saying isn't the Jaccard distance for the multi-class
case equivalent to the (1-hammingloss). Where the hamming loss is the
average of places where the two vectors are different.
>
Yeah, from what I can understand you are right. Accuracy score, zero one
loss and hamming loss are all equivalent in this case.

> I want to understand what do your examples represent? Could you give an
example where the dimension is y is 2 x 3 because I getting confused on
what the 2 represents, is it the number of columns or number of rows?
>

In multi label classification, prediction will be a 2D array of 0 and 1s.
It's shape is (n_outputs, n_labels). So, a 2X3 array represents 2 outputs
and 3 labels possible for each of them. A 1 represents that the label is
present for that output and 0 is otherwise.

Hence for jaccard, it sees the number of common labels across the
labels(column) in y_true and y_pred and divides it with the number of
labels present in at least one of y_true and y_pred. The weighted average
is then calculated across all outputs(rows).

So for the first example above, the first output has [0, 1] and [1, 1] as
the labels. Hence it is 1/2 =0.5 while second output has both as [1, 1]. So
it is 1. While averaged, it becomes 0.75.

PS: I am not aware of the exact reason, but in case both y_true and y_pred
are all zeros ([0, 0]) for an output, the jaccard score is taken as 1 in
the implementation.

Hope it helps.

Regards,
Maniteja.

________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to