triya.chd
triya.chd

Reputation: 13

MapReduce code for XX' of a matrix

I'm trying to find the X transpose X of a matrix using Hadoop MapReduce. The input file is csv format, with row_id, col_id, value. The row_id and column_id need not be in a sorted format. The problem is what to emit using mapper. I do not want to store the whole matrix. I am using a MapWritable to emit output of the form

context.emit(col_id, mapw)

where mapw is map(row_id, value) because the matrices are multipled using the column aij*bjk

Upvotes: 0

Views: 623

Answers (1)

Sharvanath
Sharvanath

Reputation: 477

Why not just emit a (col_id,Text). Format the Text as, M/M' + delimiter + row_id + delimiter + value.

Upvotes: 0

Related Questions