mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ARROYO MANCEBO David <david.arr...@altran.com>
Subject Tanimoto Coefficient
Date Wed, 17 Dec 2014 09:09:56 GMT
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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message