You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by ARROYO MANCEBO David <da...@altran.com> on 2014/12/17 10:09:56 UTC

Tanimoto Coefficient

Hi mahouters,

Is useful and acceptable the tanimoto coefficient for an user similarity or only for item similarity ?

       public static void main(String[] args) {
             try {
                    DataModel model = new FileDataModel(new File("data/dataset.csv"));
                    UserSimilarity similarity = new TanimotoCoefficientSimilarity(model);
                    UserNeighborhood neighborhood = new ThresholdUserNeighborhood(0.1, similarity, model);
                    UserBasedRecommender recommender = new GenericUserBasedRecommender(model, neighborhood, similarity);
                    List<RecommendedItem> recommendations = recommender.recommend(2, 3);
                    for (RecommendedItem recommendation : recommendations) {
                      System.out.println(recommendation);
                    }
             } catch (IOException e) {
                    e.printStackTrace();
             } catch (TasteException e) {
                    e.printStackTrace();
             }
       }

Thanks.

RE: Tanimoto Coefficient

Posted by ARROYO MANCEBO David <da...@altran.com>.
Thanks, I will use it in my solution :)

-----Mensaje original-----
De: Andrew Musselman [mailto:andrew.musselman@gmail.com] 
Enviado el: miƩrcoles, 17 de diciembre de 2014 19:48
Para: user@mahout.apache.org
Asunto: Re: Tanimoto Coefficient

I've never used it in production but there's no reason not to try it out, and there's nothing stopping you from applying it to users as well as items.

On Wed, Dec 17, 2014 at 1:09 AM, ARROYO MANCEBO David < david.arroyo@altran.com> wrote:
>
> Hi mahouters,
>
> Is useful and acceptable the tanimoto coefficient for an user 
> similarity or only for item similarity ?
>
>        public static void main(String[] args) {
>              try {
>                     DataModel model = new FileDataModel(new 
> File("data/dataset.csv"));
>                     UserSimilarity similarity = new 
> TanimotoCoefficientSimilarity(model);
>                     UserNeighborhood neighborhood = new 
> ThresholdUserNeighborhood(0.1, similarity, model);
>                     UserBasedRecommender recommender = new 
> GenericUserBasedRecommender(model, neighborhood, similarity);
>                     List<RecommendedItem> recommendations = 
> recommender.recommend(2, 3);
>                     for (RecommendedItem recommendation : 
> recommendations) {
>                       System.out.println(recommendation);
>                     }
>              } catch (IOException e) {
>                     e.printStackTrace();
>              } catch (TasteException e) {
>                     e.printStackTrace();
>              }
>        }
>
> Thanks.
>

Re: Tanimoto Coefficient

Posted by Andrew Musselman <an...@gmail.com>.
I've never used it in production but there's no reason not to try it out,
and there's nothing stopping you from applying it to users as well as items.

On Wed, Dec 17, 2014 at 1:09 AM, ARROYO MANCEBO David <
david.arroyo@altran.com> wrote:
>
> Hi mahouters,
>
> Is useful and acceptable the tanimoto coefficient for an user similarity
> or only for item similarity ?
>
>        public static void main(String[] args) {
>              try {
>                     DataModel model = new FileDataModel(new
> File("data/dataset.csv"));
>                     UserSimilarity similarity = new
> TanimotoCoefficientSimilarity(model);
>                     UserNeighborhood neighborhood = new
> ThresholdUserNeighborhood(0.1, similarity, model);
>                     UserBasedRecommender recommender = new
> GenericUserBasedRecommender(model, neighborhood, similarity);
>                     List<RecommendedItem> recommendations =
> recommender.recommend(2, 3);
>                     for (RecommendedItem recommendation : recommendations)
> {
>                       System.out.println(recommendation);
>                     }
>              } catch (IOException e) {
>                     e.printStackTrace();
>              } catch (TasteException e) {
>                     e.printStackTrace();
>              }
>        }
>
> Thanks.
>