Return-Path: X-Original-To: apmail-mahout-user-archive@www.apache.org Delivered-To: apmail-mahout-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E7620104BD for ; Thu, 13 Feb 2014 04:50:58 +0000 (UTC) Received: (qmail 55790 invoked by uid 500); 13 Feb 2014 04:50:57 -0000 Delivered-To: apmail-mahout-user-archive@mahout.apache.org Received: (qmail 55109 invoked by uid 500); 13 Feb 2014 04:50:55 -0000 Mailing-List: contact user-help@mahout.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@mahout.apache.org Delivered-To: mailing list user@mahout.apache.org Received: (qmail 55101 invoked by uid 500); 13 Feb 2014 04:50:54 -0000 Delivered-To: apmail-lucene-mahout-user@lucene.apache.org Received: (qmail 55098 invoked by uid 99); 13 Feb 2014 04:50:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Feb 2014 04:50:54 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jiangwen127@gmail.com designates 209.85.128.171 as permitted sender) Received: from [209.85.128.171] (HELO mail-ve0-f171.google.com) (209.85.128.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Feb 2014 04:50:49 +0000 Received: by mail-ve0-f171.google.com with SMTP id pa12so8103860veb.16 for ; Wed, 12 Feb 2014 20:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=iDrBzjof0u56DIicVd+V6QciBZjdGbNLcHdsD3alr6Y=; b=kSf8/UAe8oB6Qz/wfhnEgeJS8TGCaLYgmWmZZlN+jmOYDABOsyxqJLM3R12r6apUOs WoEXI/+LSjZkN7fKjUXvPQXZTddAy/VgqdqsEoR4k/lDskThhHEEeB3CQVxLlFrJY8F3 eA4Utues7SVcPJdTbMmI/d0fvE0Qtw2/Kjngzeka1wIoHWCTlCEBdLiG6L8xtXja3noQ 6GSANfeiPT9VL7mhxEtBdYn10mRdP/QMq0b6BZergFpOYwHFr8LOdDDg8F8fgFhpVGrr cVpLricYM+dSsmdmhJe19e0L3IiiQPe4esxgS9YL7C6g8zt4HiIc79Oi/Q/ppUlfwgf7 apDg== MIME-Version: 1.0 X-Received: by 10.58.85.133 with SMTP id h5mr35407060vez.4.1392267028720; Wed, 12 Feb 2014 20:50:28 -0800 (PST) Received: by 10.52.113.38 with HTTP; Wed, 12 Feb 2014 20:50:28 -0800 (PST) Date: Thu, 13 Feb 2014 12:50:28 +0800 Message-ID: Subject: Why some userId has no recommendations? From: jiangwen jiang To: mahout-user@lucene.apache.org Content-Type: multipart/alternative; boundary=047d7b86f0baadf50804f2426da7 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b86f0baadf50804f2426da7 Content-Type: text/plain; charset=ISO-8859-1 Hi, all: I try to user mahout api to make recommendations, but I find some userId has no recommendations, why? here is my code public static void main(String args[]) throws Exception { String inFile = "F:\\hadoop\\data\\recsysinput.txt"; DataModel dataModel = new FileDataModel(new File(inFile)); UserSimilarity userSimilarity = new PearsonCorrelationSimilarity(dataModel); UserNeighborhood userNeighborhood = new NearestNUserNeighborhood(100, userSimilarity, dataModel); Recommender recommender = new GenericUserBasedRecommender(dataModel, userNeighborhood, userSimilarity); for (int i = 1; i <= 5; i++) { List recommendations = recommender.recommend(i, 1); System.out.println("recommend for user:" + i); for (RecommendedItem recommendation : recommendations) { System.out.println(recommendation); } } } input data(recsysinput.txt): 1,101,5.0 1,102,3.0 1,103,2.5 2,101,2 2,102,2.5 2,103,5 2,104,2 3,101,2.5 3,104,4 3,105,4.5 3,107,5 4,101,5 4,103,3 4,104,4.5 4,106,4 5,101,4 5,102,3 5,103,2 5,104,4 5,105,3.5 5,106,4 output: recommend for user:1 RecommendedItem[item:104, value:5.0] recommend for user:2 RecommendedItem[item:106, value:4.0] recommend for user:3 RecommendedItem[item:106, value:4.0] recommend for user:4 RecommendedItem[item:105, value:5.0] recommend for user:5 UserId 5 has no recommendations, is it right? Can I get some recommendations for userId 5, even if the recommendation results are not good enough? thanks Regards! --047d7b86f0baadf50804f2426da7--