本文主要是介绍向MapReduce转换:通过部分成绩计算矩阵乘法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
代码共分为四部分:
<strong><span style="font-size:18px;">/**** @author YangXin* @info 封装共现关系列*/
package unitSix;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.mahout.cf.taste.hadoop.item.VectorOrPrefWritable;
import org.apache.mahout.math.VectorWritable;public class CooccurrenceColumnWrapperMapper extends Mapper<IntWritable, VectorWritable, IntWritable, VectorOrPrefWritable>{public void map(IntWritable key, VectorWritable value, Context context) throws IOException, InterruptedException{context.write(key, new VectorOrPrefWritable(value.get()));}
}
</span></strong>
<strong><span style="
这篇关于向MapReduce转换:通过部分成绩计算矩阵乘法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!