Hi,
jaccard similarity coefficient or score is the ratio of size of
intersection to the size of union of the to label sets .
In this case the size of union is 4 and that of intersection is 2 . Hence
the jaccard similarity score will be 2/4=0.5.

I hope this will help.

Regards,
Bharat.



On Mon, May 9, 2016 at 4:05 AM, Shishir Pandey <shishir...@gmail.com> wrote:

> I a bit confused regarding the Jaccard similarity score.  The example
> given on :
>
> http://scikit-learn.org/stable/modules/generated/sklearn.metrics.jaccard_similarity_score.html#sklearn.metrics.jaccard_similarity_score
>
> >>> import numpy as np>>> from sklearn.metrics import 
> >>> jaccard_similarity_score>>> y_pred = [0, 2, 1, 3]
>
> I am assuming that here each dimension is a label and the entry
> represents how many times that label appears. Also I am assuming that
>
> the each entry has weight of 1.
>
>
>
>
> >>> y_true = [0, 1, 2, 3]
>
>
> Then, A \intersection B (y_pred and y_true) will be = 1 + 1 + 3 = 5
>
> and A \union B will be = 3 + 3 + 3 = 9
>
> How is the jaccard similarity = 0.5?
>
>
> >>> jaccard_similarity_score(y_true, y_pred)0.5>>> 
> >>> jaccard_similarity_score(y_true, y_pred, normalize=False)2
>
>
> --
> sp
>
>
> ------------------------------------------------------------------------------
> 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
>
>
------------------------------------------------------------------------------
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