sorry my fault forgot to change output format to TextOutputFormat: Job predictRatings = prepareJob(getInputPath(), predict, TextInputFormat.class, PredictRatingsMapper.class, Text.class, NullWritable.class, TextOutputFormat.class);
On 16 September 2013 10:24, Stuart Horsman <[email protected]> wrote: > Hi All, > > I'm trying to print out the ratings predictions from the ALS-WR hadoop job > and have copied FactorizationEvaluator and have to PredictorEvaluator and > have updated the job to print out the ratings based on an input file. The > final loop simply does: > > if (U.containsKey(userID) && M.containsKey(itemID)) { > double estimate = U.get(userID).dot(M.get(itemID)); > String rating = userID + "," + itemID + "," + estimate; > > ctx.write(new Text(rating), NullWritable.get()); > } > however the output of the map job is not Text as what I was expecting, but > the following: > > SEQ^F^Yorg.apache.hadoop.io.Text!org.apache.hadoop.io.NullWritable^@^@^@^@^@^@.ñÖ^E<9e>PA^E<9a>ânüÁ;,ï^@^@^@ > ^@^@^@ > ^_45882080,4298,3.448909581373436^@^@^@"^@^@^@"!70331108,12285,3.6083552170751596^@^@^@!^@^@^@! > 53417379,15230,1.936937097038839^@^@^@ ^@^@^@ > ^_90607973,3785,4.690291927345934^@^@^@"^@^@^@"!46768202,23146,2.4260144690777854^@^@^@"^@^@^@"!53145456,14802,1.8729882859821854 > > Is there some other formatting step I need to do first before calling > ctx.write? > > Thanks > > Stuart >
