mahout算法源码分析之Itembased Collaborative Filtering(一)PreparePreferenceMatrixJob(三)

2014-11-24 09:04:20 · 作者: · 浏览: 3
ATING_MATRIX,格式为: : itemID-->vector[userID:prefValue,userID:prefVlaue,...];
额 ,好吧,那个sampleSize是有值的,而非默认的Integer的最大值:
[java]
if (hasOption("maxPrefsPerUser")) {
int samplingSize = Integer.parseInt(getOption("maxPrefsPerUser"));
toItemVectors.getConfiguration().setInt(ToItemVectorsMapper.SAMPLE_SIZE, samplingSize);
}
这个值也是可以设置的,所以现在你知道maxPrefsPerUser的值的用处了。但是这个值的默认是100,实战总的item才7,所以numElementsBeforeSampling - numElementsAfterSampling=0不变。
好了,这个job也分析完了。