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 F25B6E115 for ; Mon, 14 Jan 2013 12:48:46 +0000 (UTC) Received: (qmail 7701 invoked by uid 500); 14 Jan 2013 12:48:45 -0000 Delivered-To: apmail-mahout-user-archive@mahout.apache.org Received: (qmail 7643 invoked by uid 500); 14 Jan 2013 12:48:45 -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 7616 invoked by uid 99); 14 Jan 2013 12:48:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jan 2013 12:48:44 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stutiawasthi@hcl.com designates 203.105.185.25 as permitted sender) Received: from [203.105.185.25] (HELO gws06.hcl.com) (203.105.185.25) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jan 2013 12:48:39 +0000 X-IronPort-AV: E=Sophos;i="4.84,468,1355077800"; d="scan'208";a="23441290" Received: from unknown (HELO NDA-HCLIN-HT03.CORP.HCL.IN) ([10.248.64.34]) by gws06.hcl.com with ESMTP/TLS/AES128-SHA; 14 Jan 2013 18:15:22 +0530 Received: from NDA-HCLC-HT02.HCLC.CORP.HCL.IN (10.33.64.134) by NDA-HCLIN-HT03.CORP.HCL.IN (10.248.64.34) with Microsoft SMTP Server (TLS) id 8.3.245.1; Mon, 14 Jan 2013 18:18:15 +0530 Received: from NDA-HCLC-EVS02.HCLC.CORP.HCL.IN ([fe80::3502:ae26:ebb9:cb58]) by NDA-HCLC-HT02.HCLC.CORP.HCL.IN ([fe80::59bd:b0cb:657b:3d97%11]) with mapi; Mon, 14 Jan 2013 18:18:15 +0530 From: Stuti Awasthi To: "user@mahout.apache.org" Date: Mon, 14 Jan 2013 18:18:14 +0530 Subject: RE: MatrixMultiplicationJob Input query Thread-Topic: MatrixMultiplicationJob Input query Thread-Index: Ac3yTzSBpJ9kisjvQrOXmXxEfM/mOAABX37Q Message-ID: <50CFD234CC7D3A4EA1E8910D3866F700095256F282@NDA-HCLC-EVS02.HCLC.CORP.HCL.IN> References: <50CFD234CC7D3A4EA1E8910D3866F700095256F07C@NDA-HCLC-EVS02.HCLC.CORP.HCL.IN> <50CFD234CC7D3A4EA1E8910D3866F700095256F0F7@NDA-HCLC-EVS02.HCLC.CORP.HCL.IN> <50CFD234CC7D3A4EA1E8910D3866F700095256F1AF@NDA-HCLC-EVS02.HCLC.CORP.HCL.IN> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi Ashish, Thanks for the response. The code snippet you gave certainly worked for the= matrix multiplication. But in my usecase the matrix will be large dense ma= trix say 1millionX 1million.=20 For such large matrix, I was thinking to try the MatrixMultiplicationJob (M= R job) provided by Mahout and if I can use this for such dense distributed = matrix and check the performance also. Thanks -----Original Message----- From: ashish negi [mailto:ashishnegioffice@gmail.com]=20 Sent: Monday, January 14, 2013 5:33 PM To: user@mahout.apache.org Subject: Re: MatrixMultiplicationJob Input query Hi, I'll try as you said meanwhile following is how I prototyped matrix multipl= ication. Hope it'll satisfy your matrix multiplication need. ------ import org.apache.mahout.math.Matrix; import org.apache.mahout.math.SequentialAccessSparseVector; import org.apache.mahout.math.SparseMatrix; import org.apache.mahout.math.Vector; public class MatrixMult { public static void main(String[] args) { int n =3D 0; int m =3D 1; Vector vector =3D new SequentialAccessSparseVector(n); Matrix matrix =3D new SparseMatrix(2,2);//(new int[] {2, 2}); matrix.set(0, new double[]{2.0,2.0}); matrix.set(1, new double[]{2.0,2.0}); Matrix productMatrix =3D matrix.times(matrix); //Vector product =3D productMatrix.getColumn(0); } } Regards, On Mon, Jan 14, 2013 at 4:05 PM, Stuti Awasthi wrote= : > Hi Ashish, > > Im running the job like this : > > mahout matrixmult --inputPathA --numRowsA =20 > --numColsA --inputPathB =20 > --numRowsB --numColsB =20 > --tempDir > > And getting the errors of InputFormat in mapper as mapper expects=20 > format. Now here Im not sure that what should be the=20 > keys and Value as Input to mapper to get this job working= . > > -Stuti > > > -----Original Message----- > From: ashish negi [mailto:ashishnegioffice@gmail.com] > Sent: Monday, January 14, 2013 2:29 PM > To: user@mahout.apache.org > Subject: Re: MatrixMultiplicationJob Input query > > Could you tell how are you trying to run the job? > > Regards, > > On Mon, Jan 14, 2013 at 1:42 PM, Stuti Awasthi > wrote: > > > Hi Ashish, > > I tried to run the "matrixmult" example of Mahout but getting errors=20 > > in input format. I want to create the input file of matrix in the=20 > > format which is required by MatrixMultiplicationJob for further=20 > > processing. Im facing issues in creating that file as I have doubts=20 > > that what will be the key and values for the input file. Anybody's=20 > > help > will be appreciated. > > > > Thanks > > Stuti > > > > -----Original Message----- > > From: ashish negi [mailto:ashishnegioffice@gmail.com] > > Sent: Monday, January 14, 2013 1:04 PM > > To: user@mahout.apache.org > > Subject: Re: MatrixMultiplicationJob Input query > > > > Hi Stuti, > > > > I am not with specific answer of your question but why don't you try=20 > > few examples to guess the algorithm or browse source code. > > > > Regards, > > Ashish > > > > On Mon, Jan 14, 2013 at 12:20 PM, Stuti Awasthi=20 > > > >wrote: > > > > > Hi, > > > I want to execute MatrixMultiplicationJob provided in Mahout. I=20 > > > understand that the input file should be in SequenceFileFormat=20 > > > with input Key as IntWritable and Value as TupleWritable. > > > > > > If my matrix is 2x3 like : > > > > > > A =3D 1 2 3 > > > 4 5 6 > > > > > > What should I keep as key and value in SequenceFileFormat so that=20 > > > I can provide it in MatrixMultiplicationJob as input. Sorry for=20 > > > the basic question but Im new to Mahout and not finding much=20 > > > details of MatrixMultiplicationJob execution. > > > > > > Thanks > > > Stuti > > > > > > > > > ::DISCLAIMER:: > > > > > > ------------------------------------------------------------------ > > > -- > > > -- > > > ------------------------------------------------------------------ > > > -- > > > -- > > > -------- > > > > > > The contents of this e-mail and any attachment(s) are confidential=20 > > > and intended for the named recipient(s) only. > > > E-mail transmission is not guaranteed to be secure or error-free=20 > > > as information could be intercepted, corrupted, lost, destroyed,=20 > > > arrive late or incomplete, or may contain viruses in transmission.=20 > > > The e mail and its contents (with or without referred errors)=20 > > > shall therefore not attach any liability on the originator or HCL=20 > > > or its > affiliates. > > > Views or opinions, if any, presented in this email are solely=20 > > > those of the author and may not necessarily reflect the views or=20 > > > opinions of HCL or its affiliates. Any form of reproduction,=20 > > > dissemination, copying, disclosure, modification, distribution and=20 > > > / or publication of this message without the prior written consent=20 > > > of authorized representative of HCL is strictly prohibited. If you=20 > > > have received this email in error please delete it and notify the=20 > > > sender immediately. > > > Before opening any email and/or attachments, please check them for=20 > > > viruses and other defects. > > > > > > > > > ------------------------------------------------------------------ > > > -- > > > -- > > > > > -------------------------------------------------------------------- > > -- > > -------- > > > > > >