This is what I am having trouble understanding. What does each dimension of
the vector represent? I am thinking of it as follows:

[label_1, label_2, ..., label_N]

a characteristic vector would be something like [1, 1, 0, ..., 1, 0, 0]

This represents weather label_i is present in the set or not? In that case
the answer would be different. A 0 is the two sets would represent that the
label is not present in either of the sets and hence the union would be
smaller than the dimension of the vector.

--
sp

On Mon, May 9, 2016 at 5:11 PM, Bharat Didwania 4-Yr B.Tech. Electrical
Engg. <bharat.didwania.ee...@itbhu.ac.in> wrote:

> 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
>
>
------------------------------------------------------------------------------
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