Set::Similarity::BV::Dice - Dice coefficent for sets
use Set::Similarity::BV::Dice; my $dice = Set::Similarity::BV::Dice->new; my $similarity = $dice->similarity('af09ff','9c09cc');
The Dice coefficient is the number of elements in common to both sets relative to the average size of the total number of elements present, i.e.
( A intersect B ) / 0.5 ( A + B ) # the same as sorensen
The weighting factor comes from the 0.5 in the denominator. The range is 0 to 1.
Set::Similarity::BV::Dice inherits all methods from Set::Similarity::BV and implements the following new ones.
my $similarity = $object->from_integers($AoI1,$AoI2);
This method expects two array references of integers as parameters. The parameters are not checked, thus can lead to funny results or uncatched divisions by zero.
If you want to use this method directly, you should catch the situation where one of the parameters is empty (similarity is 0), or both are empty (similarity is 1).
http://github.com/wollmers/Set-Similarity-BV-BV
Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>
Copyright (C) 2016 by Helmut Wollmersdorfer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Set::Similarity::BV, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Set::Similarity::BV
CPAN shell
perl -MCPAN -e shell install Set::Similarity::BV
For more information on module installation, please visit the detailed CPAN module installation guide.