0

问题描述:

我正在使用 Mahout GeneircItemBasedRecommender 在 Movielens 1m 数据上运行,但对测试数据集的命中始终为 0,精度结果仅为 0.056528926,这既不合理也不可接受。另一方面,当使用 GenericUserBasedRecommender 时,我可以得到精度:0.13883367,为什么会这样?我可以理解为什么基于项目和基于用户的算法之间存在如此大的差异,我的代码有什么问题吗?我读过Mahout Precision Recall Movielens 10M,但似乎没有回答我的问题。

概括:

  • Item-Based Recommender 的命中率/精度极低,而 User-Based 的命中率/精度似乎是有道理的
  • Item-Based Recommender 推荐的物品停留在 0~500 左右,而 User-Based 的推荐物品谱似乎是有道理的
  • Item-Based Recommender 给 ALL 推荐的 item 的预测值是 5,而 User-Based 的预测值大约在 1/9 以下
  • SlopeOne Recommender 与 Item-Based Recommender 的行为类似

注:结果是按5:5拆分数据时给出的(2折交叉验证)

附件:

  • 爪哇代码
  • 结果日志
  • mahout pom 文件

请帮忙!!!!提前致谢!!!

Java 代码:

import com.bestv.mahout.deprecated.SimilarityFactory;
import org.apache.mahout.cf.taste.common.TasteException;
import org.apache.mahout.cf.taste.common.Weighting;
import org.apache.mahout.cf.taste.eval.IRStatistics;
import org.apache.mahout.cf.taste.eval.RecommenderBuilder;
import org.apache.mahout.cf.taste.eval.RecommenderEvaluator;
import org.apache.mahout.cf.taste.eval.RecommenderIRStatsEvaluator;
import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
import org.apache.mahout.cf.taste.impl.eval.GenericRecommenderIRStatsEvaluator;
import org.apache.mahout.cf.taste.impl.eval.RMSRecommenderEvaluator;
import org.apache.mahout.cf.taste.impl.model.file.FileDataModel;
import org.apache.mahout.cf.taste.impl.neighborhood.NearestNUserNeighborhood;
import org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender;
import org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender;
import org.apache.mahout.cf.taste.impl.recommender.slopeone.SlopeOneRecommender;
import org.apache.mahout.cf.taste.impl.similarity.PearsonCorrelationSimilarity;
import org.apache.mahout.cf.taste.model.DataModel;
import org.apache.mahout.cf.taste.neighborhood.UserNeighborhood;
import org.apache.mahout.cf.taste.recommender.RecommendedItem;
import org.apache.mahout.cf.taste.recommender.Recommender;
import org.apache.mahout.cf.taste.similarity.ItemSimilarity;
import org.apache.mahout.cf.taste.similarity.UserSimilarity;
import org.apache.mahout.common.RandomUtils;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;


public class RecommenderEvaluatorTest {

    @Test
    public void testSelfItemBasedIREvaluator() throws IOException, TasteException {
        DataModel trainDataModal = new FileDataModel(new File("/cmsdata/cflab/train/training.csv"));
        DataModel testDataModal = new FileDataModel(new File("/cmsdata/cflab/test/testing.csv"));
        ItemSimilarity perasonSimilarity = new PearsonCorrelationSimilarity(trainDataModal);
        Recommender pearsonItemRecommender = new GenericItemBasedRecommender(trainDataModal, perasonSimilarity);

        long hitCnt = 0;
        long totalCnt = 0;
        LongPrimitiveIterator userIDItr = testDataModal.getUserIDs();
        while (userIDItr.hasNext()) {
            List<Long> recIDList = new ArrayList<Long>();
            List<Long> realIDList = new ArrayList<Long>();
            Long uid = userIDItr.nextLong();
            List<RecommendedItem> recItemList = pearsonItemRecommender.recommend(uid, 10);
            for (RecommendedItem item : recItemList) {
                recIDList.add(item.getItemID());
            }
            long[] tempArr = testDataModal.getPreferencesFromUser(uid).getIDs();
            if (tempArr != null) {
                for (int i=0; i<tempArr.length; i++) {
                    realIDList.add(new Long(tempArr[i]));
                }
            }
            totalCnt += recIDList.size();
            System.out.println("------------------ userid: " + uid + "------------------");
            System.out.println(recIDList.toString());
            System.out.println(realIDList.toString());
            recIDList.retainAll(realIDList);
            hitCnt += recIDList.size();
            if (recIDList.size()>0)
                System.out.println("************ current hits: " + recIDList.size() + " ***************");
            System.out.println("=============== precision: " + (float)hitCnt/totalCnt + " ======================");
            System.out.println(recItemList);
        }
    }

    @Test
    public void testSelfUserBasedIREvaluator() throws IOException, TasteException {
        DataModel trainDataModal = new FileDataModel(new File("/cmsdata/cflab/train/training.csv"));
        DataModel testDataModal = new FileDataModel(new File("/cmsdata/cflab/test/testing.csv"));
        UserSimilarity perasonSimilarity = new PearsonCorrelationSimilarity(trainDataModal);
        NearestNUserNeighborhood neighborhood = new NearestNUserNeighborhood(20, perasonSimilarity, trainDataModal);
        Recommender pearsonItemRecommender = new GenericUserBasedRecommender(trainDataModal, neighborhood, perasonSimilarity);

        long hitCnt = 0;
        long totalCnt = 0;
        LongPrimitiveIterator userIDItr = testDataModal.getUserIDs();
        while (userIDItr.hasNext()) {
            List<Long> recIDList = new ArrayList<Long>();
            List<Long> realIDList = new ArrayList<Long>();
            Long uid = userIDItr.nextLong();
            List<RecommendedItem> recItemList = pearsonItemRecommender.recommend(uid, 10);
            for (RecommendedItem item : recItemList) {
                recIDList.add(item.getItemID());
            }
            long[] tempArr = testDataModal.getPreferencesFromUser(uid).getIDs();
            if (tempArr != null) {
                for (int i=0; i<tempArr.length; i++) {
                    realIDList.add(new Long(tempArr[i]));
                }
            }
            totalCnt += recIDList.size();
            System.out.println("------------------ userid: " + uid + "------------------");
            System.out.println(recIDList.toString());
            System.out.println(realIDList.toString());
            recIDList.retainAll(realIDList);
            hitCnt += recIDList.size();
            if (recIDList.size()>0)
                System.out.println("************ current hits: " + recIDList.size() + " *****************");
            System.out.println("=============== precision: " + (float)hitCnt/totalCnt + " =================");
            System.out.println(recItemList);
        }
    }

    @Test
    public void testSelfSlopeOneIREvaluator() throws IOException, TasteException {
        DataModel trainDataModal = new FileDataModel(new File("/cmsdata/cflab/train/training.csv"));
        DataModel testDataModal = new FileDataModel(new File("/cmsdata/cflab/test/testing.csv"));
        Recommender slopeOneRecommender = new SlopeOneRecommender(trainDataModal);

        long hitCnt = 0;
        long totalCnt = 0;
        LongPrimitiveIterator userIDItr = testDataModal.getUserIDs();
        while (userIDItr.hasNext()) {
            List<Long> recIDList = new ArrayList<Long>();
            List<Long> realIDList = new ArrayList<Long>();
            Long uid = userIDItr.nextLong();
            List<RecommendedItem> recItemList = slopeOneRecommender.recommend(uid, 10);
            for (RecommendedItem item : recItemList) {
                recIDList.add(item.getItemID());
            }
            long[] tempArr = testDataModal.getPreferencesFromUser(uid).getIDs();
            if (tempArr != null) {
                for (int i=0; i<tempArr.length; i++) {
                    realIDList.add(new Long(tempArr[i]));
                }
            }
            totalCnt += recIDList.size();
            System.out.println("------------------ userid: " + uid + "------------------");
            System.out.println(recIDList.toString());
            System.out.println(realIDList.toString());
            recIDList.retainAll(realIDList);
            hitCnt += recIDList.size();
            if (recIDList.size()>0)
                System.out.println("************ current hits: " + recIDList.size() + " *****************");
            System.out.println("=============== precision: " + (float)hitCnt/totalCnt + " =================");
            System.out.println(recItemList);
        }
    }
}

基于项目的日志(用户 1-20,几乎没有命中记录)

------------------ userid: 1------------------
[84, 81, 61, 71, 75, 15, 7, 57, 64, 26]
[1, 48, 150, 260, 531, 588, 594, 595, 661, 783, 914, 938, 1022, 1029, 1035, 1207, 1246, 1270, 1545, 1566, 1962, 2028, 2294, 2321, 2340, 2398, 2762, 2791, 2804]
=============== precision: 0.0 ======================
[RecommendedItem[item:84, value:5.0], RecommendedItem[item:81, value:5.0], RecommendedItem[item:61, value:5.0], RecommendedItem[item:71, value:5.0], RecommendedItem[item:75, value:5.0], RecommendedItem[item:15, value:5.0], RecommendedItem[item:7, value:5.0], RecommendedItem[item:57, value:5.0], RecommendedItem[item:64, value:5.0], RecommendedItem[item:26, value:5.0]]
------------------ userid: 2------------------
[216, 166, 117, 183, 190, 37, 106, 128, 97, 33]
[21, 95, 163, 165, 235, 292, 318, 349, 356, 434, 457, 459, 590, 593, 647, 648, 902, 920, 982, 1084, 1124, 1193, 1198, 1207, 1217, 1244, 1253, 1259, 1293, 1357, 1372, 1527, 1552, 1784, 1834, 1873, 1917, 1955, 1962, 1968, 2002, 2006, 2028, 2067, 2126, 2194, 2278, 2312, 2353, 2396, 2427, 2490, 2501, 2628, 2852, 2858, 3035, 3095, 3257, 3334, 3578, 3678, 3809, 3893]
=============== precision: 0.0 ======================
[RecommendedItem[item:216, value:5.0], RecommendedItem[item:166, value:5.0], RecommendedItem[item:117, value:5.0], RecommendedItem[item:183, value:5.0], RecommendedItem[item:190, value:5.0], RecommendedItem[item:37, value:5.0], RecommendedItem[item:106, value:5.0], RecommendedItem[item:128, value:5.0], RecommendedItem[item:97, value:5.0], RecommendedItem[item:33, value:5.0]]
------------------ userid: 3------------------
[182, 174, 114, 97, 162, 82, 78, 8, 55, 59]
[260, 480, 552, 1079, 1197, 1198, 1210, 1259, 1261, 1270, 1580, 2617, 2735, 2858, 2997, 3421, 3534, 3619, 3671]
=============== precision: 0.0 ======================
[RecommendedItem[item:182, value:5.0], RecommendedItem[item:174, value:5.0], RecommendedItem[item:114, value:5.0], RecommendedItem[item:97, value:5.0], RecommendedItem[item:162, value:5.0], RecommendedItem[item:82, value:5.0], RecommendedItem[item:78, value:5.0], RecommendedItem[item:8, value:5.0], RecommendedItem[item:55, value:5.0], RecommendedItem[item:59, value:5.0]]
------------------ userid: 4------------------
[87, 86, 72, 55, 75, 40, 46, 28, 12, 30]
[1210, 1214, 1240, 2028, 2951, 3468, 3527]
=============== precision: 0.0 ======================
[RecommendedItem[item:87, value:5.0], RecommendedItem[item:86, value:5.0], RecommendedItem[item:72, value:5.0], RecommendedItem[item:55, value:5.0], RecommendedItem[item:75, value:5.0], RecommendedItem[item:40, value:5.0], RecommendedItem[item:46, value:5.0], RecommendedItem[item:28, value:5.0], RecommendedItem[item:12, value:5.0], RecommendedItem[item:30, value:5.0]]
------------------ userid: 5------------------
[340, 324, 321, 258, 287, 87, 263, 128, 33, 234]
[6, 24, 39, 41, 47, 52, 224, 272, 288, 296, 318, 321, 356, 377, 497, 509, 515, 800, 866, 896, 913, 994, 1127, 1171, 1175, 1192, 1243, 1279, 1392, 1449, 1466, 1500, 1529, 1535, 1610, 1643, 1649, 1650, 1683, 1684, 1715, 1719, 1729, 1730, 1734, 1747, 1788, 1909, 1912, 1966, 2028, 2058, 2188, 2268, 2318, 2337, 2355, 2359, 2390, 2395, 2427, 2428, 2580, 2683, 2700, 2716, 2721, 2723, 2762, 2858, 2952, 2987, 2997, 3006, 3016, 3020, 3079, 3083, 3260, 3386, 3408, 3409, 3476, 3513, 3578, 3624, 3744, 3786, 3793, 3799]
************ current hits: 1 ***************
=============== precision: 0.02 ======================
[RecommendedItem[item:340, value:5.0], RecommendedItem[item:324, value:5.0], RecommendedItem[item:321, value:5.0], RecommendedItem[item:258, value:5.0], RecommendedItem[item:287, value:5.0], RecommendedItem[item:87, value:5.0], RecommendedItem[item:263, value:5.0], RecommendedItem[item:128, value:5.0], RecommendedItem[item:33, value:5.0], RecommendedItem[item:234, value:5.0]]
------------------ userid: 6------------------
[210, 209, 202, 190, 148, 101, 30, 175, 44, 38]
[199, 266, 368, 377, 383, 588, 595, 597, 920, 1028, 1035, 1101, 1188, 1210, 1296, 1441, 1674, 1947, 1959, 2017, 2100, 2406, 2506, 2802, 2858, 3074, 3501, 3508, 3600, 3624, 3699]
=============== precision: 0.016666668 ======================
[RecommendedItem[item:210, value:5.0], RecommendedItem[item:209, value:5.0], RecommendedItem[item:202, value:5.0], RecommendedItem[item:190, value:5.0], RecommendedItem[item:148, value:5.0], RecommendedItem[item:101, value:5.0], RecommendedItem[item:30, value:5.0], RecommendedItem[item:175, value:5.0], RecommendedItem[item:44, value:5.0], RecommendedItem[item:38, value:5.0]]
------------------ userid: 7------------------
[200, 189, 147, 154, 171, 80, 7, 68, 35, 49]
[6, 110, 349, 457, 474, 480, 589, 1221, 1270, 1573, 1610, 1722, 1997, 2028, 2571, 2916, 3256, 3578, 3753]
=============== precision: 0.014285714 ======================
[RecommendedItem[item:200, value:5.0], RecommendedItem[item:189, value:5.0], RecommendedItem[item:147, value:5.0], RecommendedItem[item:154, value:5.0], RecommendedItem[item:171, value:5.0], RecommendedItem[item:80, value:5.0], RecommendedItem[item:7, value:5.0], RecommendedItem[item:68, value:5.0], RecommendedItem[item:35, value:5.0], RecommendedItem[item:49, value:5.0]]
------------------ userid: 8------------------
[202, 183, 75, 104, 80, 44, 33, 53, 98, 28]
[14, 16, 17, 24, 25, 39, 42, 110, 111, 150, 151, 161, 163, 230, 253, 265, 269, 288, 296, 337, 345, 377, 506, 508, 527, 538, 555, 589, 741, 1059, 1120, 1210, 1213, 1277, 1357, 1393, 1476, 1573, 1580, 1589, 1621, 1639, 1660, 1673, 1678, 1682, 1693, 1704, 1711, 1730, 1916, 2006, 2028, 2278, 2297, 2320, 2396, 2427, 2429, 2571, 2600, 2688, 2692, 2699, 2712, 2858, 3105, 3107, 3147, 3155, 3213, 3246, 3250, 3267, 3386, 3425, 3481]
=============== precision: 0.0125 ======================
[RecommendedItem[item:202, value:5.0], RecommendedItem[item:183, value:5.0], RecommendedItem[item:75, value:5.0], RecommendedItem[item:104, value:5.0], RecommendedItem[item:80, value:5.0], RecommendedItem[item:44, value:5.0], RecommendedItem[item:33, value:5.0], RecommendedItem[item:53, value:5.0], RecommendedItem[item:98, value:5.0], RecommendedItem[item:28, value:5.0]]
------------------ userid: 9------------------
[210, 200, 102, 157, 149, 49, 46, 119, 146, 28]
[1, 25, 50, 223, 318, 349, 367, 377, 412, 428, 457, 508, 529, 590, 593, 778, 805, 920, 1060, 1089, 1210, 1223, 1265, 1307, 1343, 1393, 1466, 1552, 1639, 1682, 1721, 1784, 1921, 1961, 2028, 2268, 2302, 3006, 3147, 3148, 3253, 3255, 3298, 3484, 3510, 3751, 3793]
=============== precision: 0.011111111 ======================
[RecommendedItem[item:210, value:5.0], RecommendedItem[item:200, value:5.0], RecommendedItem[item:102, value:5.0], RecommendedItem[item:157, value:5.0], RecommendedItem[item:149, value:5.0], RecommendedItem[item:49, value:5.0], RecommendedItem[item:46, value:5.0], RecommendedItem[item:119, value:5.0], RecommendedItem[item:146, value:5.0], RecommendedItem[item:28, value:5.0]]
------------------ userid: 10------------------
[297, 264, 291, 244, 263, 119, 103, 37, 97, 33]
[1, 7, 24, 32, 62, 150, 153, 180, 186, 203, 223, 275, 277, 292, 316, 317, 318, 329, 333, 351, 356, 367, 435, 480, 520, 541, 542, 543, 551, 586, 587, 595, 596, 648, 653, 671, 745, 750, 784, 802, 858, 898, 899, 904, 916, 918, 923, 938, 953, 1015, 1035, 1059, 1079, 1084, 1091, 1104, 1127, 1135, 1136, 1148, 1196, 1197, 1198, 1200, 1220, 1221, 1230, 1240, 1250, 1252, 1254, 1256, 1282, 1283, 1291, 1293, 1302, 1304, 1307, 1320, 1339, 1356, 1380, 1394, 1411, 1544, 1566, 1573, 1586, 1654, 1682, 1721, 1756, 1884, 1918, 1921, 1927, 1948, 1961, 1967, 2005, 2021, 2040, 2046, 2047, 2072, 2080, 2082, 2090, 2093, 2096, 2108, 2111, 2124, 2133, 2138, 2161, 2174, 2193, 2294, 2300, 2336, 2355, 2371, 2378, 2398, 2405, 2407, 2423, 2431, 2436, 2470, 2497, 2501, 2529, 2530, 2599, 2617, 2622, 2628, 2640, 2657, 2693, 2717, 2746, 2762, 2770, 2791, 2795, 2804, 2872, 2918, 2946, 2948, 2959, 2968, 2997, 3035, 3037, 3066, 3095, 3114, 3155, 3174, 3175, 3194, 3254, 3309, 3358, 3359, 3438, 3489, 3500, 3591, 3668, 3675, 3699, 3701, 3702, 3703, 3723, 3751, 3809, 3812, 3869, 3928]
=============== precision: 0.01 ======================
[RecommendedItem[item:297, value:5.0], RecommendedItem[item:264, value:5.0], RecommendedItem[item:291, value:5.0], RecommendedItem[item:244, value:5.0], RecommendedItem[item:263, value:5.0], RecommendedItem[item:119, value:5.0], RecommendedItem[item:103, value:5.0], RecommendedItem[item:37, value:5.0], RecommendedItem[item:97, value:5.0], RecommendedItem[item:33, value:5.0]]

UserBased log(用户1-20,有一些命中记录)

------------------ userid: 1------------------
[2248, 3479, 1952, 1208, 2966, 457, 1278, 474, 2795, 50]
[1, 48, 150, 260, 531, 588, 594, 595, 661, 783, 914, 938, 1022, 1029, 1035, 1207, 1246, 1270, 1545, 1566, 1962, 2028, 2294, 2321, 2340, 2398, 2762, 2791, 2804]
=============== precision: 0.0 =================
[RecommendedItem[item:2248, value:5.0], RecommendedItem[item:3479, value:5.0], RecommendedItem[item:1952, value:5.0], RecommendedItem[item:1208, value:5.0], RecommendedItem[item:2966, value:5.0], RecommendedItem[item:457, value:5.0], RecommendedItem[item:1278, value:5.0], RecommendedItem[item:474, value:5.0], RecommendedItem[item:2795, value:5.0], RecommendedItem[item:50, value:4.75]]
------------------ userid: 2------------------
[1259, 2501, 527, 2324, 2369, 778, 1206, 1200, 3160, 296]
[21, 95, 163, 165, 235, 292, 318, 349, 356, 434, 457, 459, 590, 593, 647, 648, 902, 920, 982, 1084, 1124, 1193, 1198, 1207, 1217, 1244, 1253, 1259, 1293, 1357, 1372, 1527, 1552, 1784, 1834, 1873, 1917, 1955, 1962, 1968, 2002, 2006, 2028, 2067, 2126, 2194, 2278, 2312, 2353, 2396, 2427, 2490, 2501, 2628, 2852, 2858, 3035, 3095, 3257, 3334, 3578, 3678, 3809, 3893]
************ current hits: 2 *****************
=============== precision: 0.1 =================
[RecommendedItem[item:1259, value:5.0], RecommendedItem[item:2501, value:5.0], RecommendedItem[item:527, value:5.0], RecommendedItem[item:2324, value:5.0], RecommendedItem[item:2369, value:5.0], RecommendedItem[item:778, value:5.0], RecommendedItem[item:1206, value:5.0], RecommendedItem[item:1200, value:5.0], RecommendedItem[item:3160, value:5.0], RecommendedItem[item:296, value:5.0]]
------------------ userid: 3------------------
[2664, 912, 318, 858, 2078, 3361, 296, 253, 223, 3178]
[260, 480, 552, 1079, 1197, 1198, 1210, 1259, 1261, 1270, 1580, 2617, 2735, 2858, 2997, 3421, 3534, 3619, 3671]
=============== precision: 0.06666667 =================
[RecommendedItem[item:2664, value:5.0], RecommendedItem[item:912, value:5.0], RecommendedItem[item:318, value:5.0], RecommendedItem[item:858, value:5.0], RecommendedItem[item:2078, value:5.0], RecommendedItem[item:3361, value:5.0], RecommendedItem[item:296, value:5.0], RecommendedItem[item:253, value:5.0], RecommendedItem[item:223, value:5.0], RecommendedItem[item:3178, value:5.0]]
------------------ userid: 4------------------
[377, 2924, 2700, 1223, 333, 34, 2565, 2571, 58, 50]
[1210, 1214, 1240, 2028, 2951, 3468, 3527]
=============== precision: 0.05 =================
[RecommendedItem[item:377, value:5.0], RecommendedItem[item:2924, value:5.0], RecommendedItem[item:2700, value:5.0], RecommendedItem[item:1223, value:5.0], RecommendedItem[item:333, value:5.0], RecommendedItem[item:34, value:5.0], RecommendedItem[item:2565, value:5.0], RecommendedItem[item:2571, value:5.0], RecommendedItem[item:58, value:5.0], RecommendedItem[item:50, value:5.0]]
------------------ userid: 5------------------
[2028, 1259, 590, 858, 2728, 318, 296, 3334, 3481, 2772]
[6, 24, 39, 41, 47, 52, 224, 272, 288, 296, 318, 321, 356, 377, 497, 509, 515, 800, 866, 896, 913, 994, 1127, 1171, 1175, 1192, 1243, 1279, 1392, 1449, 1466, 1500, 1529, 1535, 1610, 1643, 1649, 1650, 1683, 1684, 1715, 1719, 1729, 1730, 1734, 1747, 1788, 1909, 1912, 1966, 2028, 2058, 2188, 2268, 2318, 2337, 2355, 2359, 2390, 2395, 2427, 2428, 2580, 2683, 2700, 2716, 2721, 2723, 2762, 2858, 2952, 2987, 2997, 3006, 3016, 3020, 3079, 3083, 3260, 3386, 3408, 3409, 3476, 3513, 3578, 3624, 3744, 3786, 3793, 3799]
************ current hits: 3 *****************
=============== precision: 0.1 =================
[RecommendedItem[item:2028, value:5.0], RecommendedItem[item:1259, value:5.0], RecommendedItem[item:590, value:5.0], RecommendedItem[item:858, value:5.0], RecommendedItem[item:2728, value:5.0], RecommendedItem[item:318, value:5.0], RecommendedItem[item:296, value:5.0], RecommendedItem[item:3334, value:5.0], RecommendedItem[item:3481, value:5.0], RecommendedItem[item:2772, value:5.0]]
------------------ userid: 6------------------
[3462, 1278, 1219, 1225, 1207, 1079, 2137, 3159, 50, 3147]
[199, 266, 368, 377, 383, 588, 595, 597, 920, 1028, 1035, 1101, 1188, 1210, 1296, 1441, 1674, 1947, 1959, 2017, 2100, 2406, 2506, 2802, 2858, 3074, 3501, 3508, 3600, 3624, 3699]
=============== precision: 0.083333336 =================
[RecommendedItem[item:3462, value:5.0], RecommendedItem[item:1278, value:5.0], RecommendedItem[item:1219, value:5.0], RecommendedItem[item:1225, value:5.0], RecommendedItem[item:1207, value:5.0], RecommendedItem[item:1079, value:5.0], RecommendedItem[item:2137, value:5.0], RecommendedItem[item:3159, value:5.0], RecommendedItem[item:50, value:5.0], RecommendedItem[item:3147, value:5.0]]
------------------ userid: 7------------------
[899, 837, 2959, 471, 2985, 2662, 2912, 2692, 306, 1204]
[6, 110, 349, 457, 474, 480, 589, 1221, 1270, 1573, 1610, 1722, 1997, 2028, 2571, 2916, 3256, 3578, 3753]
=============== precision: 0.071428575 =================
[RecommendedItem[item:899, value:5.0], RecommendedItem[item:837, value:5.0], RecommendedItem[item:2959, value:5.0], RecommendedItem[item:471, value:5.0], RecommendedItem[item:2985, value:5.0], RecommendedItem[item:2662, value:5.0], RecommendedItem[item:2912, value:5.0], RecommendedItem[item:2692, value:5.0], RecommendedItem[item:306, value:5.0], RecommendedItem[item:1204, value:5.0]]
------------------ userid: 8------------------
[912, 928, 858, 2028, 1197, 527, 1240, 3624, 3793, 3751]
[14, 16, 17, 24, 25, 39, 42, 110, 111, 150, 151, 161, 163, 230, 253, 265, 269, 288, 296, 337, 345, 377, 506, 508, 527, 538, 555, 589, 741, 1059, 1120, 1210, 1213, 1277, 1357, 1393, 1476, 1573, 1580, 1589, 1621, 1639, 1660, 1673, 1678, 1682, 1693, 1704, 1711, 1730, 1916, 2006, 2028, 2278, 2297, 2320, 2396, 2427, 2429, 2571, 2600, 2688, 2692, 2699, 2712, 2858, 3105, 3107, 3147, 3155, 3213, 3246, 3250, 3267, 3386, 3425, 3481]
************ current hits: 2 *****************
=============== precision: 0.0875 =================
[RecommendedItem[item:912, value:5.0], RecommendedItem[item:928, value:5.0], RecommendedItem[item:858, value:5.0], RecommendedItem[item:2028, value:5.0], RecommendedItem[item:1197, value:5.0], RecommendedItem[item:527, value:4.8], RecommendedItem[item:1240, value:4.6666665], RecommendedItem[item:3624, value:4.6666665], RecommendedItem[item:3793, value:4.6666665], RecommendedItem[item:3751, value:4.6666665]]
------------------ userid: 9------------------
[2542, 1997, 589, 1250, 1193, 1732, 2804, 1197, 1350, 50]
[1, 25, 50, 223, 318, 349, 367, 377, 412, 428, 457, 508, 529, 590, 593, 778, 805, 920, 1060, 1089, 1210, 1223, 1265, 1307, 1343, 1393, 1466, 1552, 1639, 1682, 1721, 1784, 1921, 1961, 2028, 2268, 2302, 3006, 3147, 3148, 3253, 3255, 3298, 3484, 3510, 3751, 3793]
************ current hits: 1 *****************
=============== precision: 0.08888889 =================
[RecommendedItem[item:2542, value:5.0], RecommendedItem[item:1997, value:5.0], RecommendedItem[item:589, value:5.0], RecommendedItem[item:1250, value:5.0], RecommendedItem[item:1193, value:5.0], RecommendedItem[item:1732, value:5.0], RecommendedItem[item:2804, value:4.6666665], RecommendedItem[item:1197, value:4.5], RecommendedItem[item:1350, value:4.5], RecommendedItem[item:50, value:4.5]]
------------------ userid: 10------------------
[318, 1089, 3148, 3421, 1721, 2384, 1961, 1198, 608, 246]
[1, 7, 24, 32, 62, 150, 153, 180, 186, 203, 223, 275, 277, 292, 316, 317, 318, 329, 333, 351, 356, 367, 435, 480, 520, 541, 542, 543, 551, 586, 587, 595, 596, 648, 653, 671, 745, 750, 784, 802, 858, 898, 899, 904, 916, 918, 923, 938, 953, 1015, 1035, 1059, 1079, 1084, 1091, 1104, 1127, 1135, 1136, 1148, 1196, 1197, 1198, 1200, 1220, 1221, 1230, 1240, 1250, 1252, 1254, 1256, 1282, 1283, 1291, 1293, 1302, 1304, 1307, 1320, 1339, 1356, 1380, 1394, 1411, 1544, 1566, 1573, 1586, 1654, 1682, 1721, 1756, 1884, 1918, 1921, 1927, 1948, 1961, 1967, 2005, 2021, 2040, 2046, 2047, 2072, 2080, 2082, 2090, 2093, 2096, 2108, 2111, 2124, 2133, 2138, 2161, 2174, 2193, 2294, 2300, 2336, 2355, 2371, 2378, 2398, 2405, 2407, 2423, 2431, 2436, 2470, 2497, 2501, 2529, 2530, 2599, 2617, 2622, 2628, 2640, 2657, 2693, 2717, 2746, 2762, 2770, 2791, 2795, 2804, 2872, 2918, 2946, 2948, 2959, 2968, 2997, 3035, 3037, 3066, 3095, 3114, 3155, 3174, 3175, 3194, 3254, 3309, 3358, 3359, 3438, 3489, 3500, 3591, 3668, 3675, 3699, 3701, 3702, 3703, 3723, 3751, 3809, 3812, 3869, 3928]
************ current hits: 4 *****************

Mahout POM 文件(部分)

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.mahout</groupId>
  <artifactId>mahout</artifactId>
  <version>0.8-SNAPSHOT</version>

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>9</version>
  </parent>

  <packaging>pom</packaging>
  <name>Apache Mahout</name>
  <url>http://mahout.apache.org</url>
  <inceptionYear>2008</inceptionYear>
  <description>
  </description>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <organization>
    <name>The Apache Software Foundation</name>
    <url>http://www.apache.org/</url>
  </organization>

  <properties>
    <skipTests>false</skipTests>
    <maven.clover.multiproject>true</maven.clover.multiproject>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <hadoop.version>1.1.2</hadoop.version>
    <lucene.version>4.2.0</lucene.version>
  </properties>
  <issueManagement>
    <system>Jira</system>
    <url>https://issues.apache.org/jira/browse/MAHOUT</url>
  </issueManagement>

  <repositories>
    <repository>
      <id>apache.snapshots</id>
      <name>Apache Snapshot Repository</name>
      <url>http://repository.apache.org/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>

</project>
4

0 回答 0