本文整理汇总了Java中org.apache.mahout.math.map.OpenIntIntHashMap类的典型用法代码示例。如果您正苦于以下问题:Java OpenIntIntHashMap类的具体用法?Java OpenIntIntHashMap怎么用?Java OpenIntIntHashMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenIntIntHashMap类属于org.apache.mahout.math.map包,在下文中一共展示了OpenIntIntHashMap类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getFListMap
import org.apache.mahout.math.map.OpenIntIntHashMap; //导入依赖的package包/类
/**
* @param dictionaryFilePath
* @param sigma
* @return
* @throws IOException
*/
public OpenIntIntHashMap getFListMap(String dictionaryFilePath, int sigma) throws IOException {
OpenIntIntHashMap fListMap = new OpenIntIntHashMap();
int[] colsToLoad = new int[2];
colsToLoad[0] = Constants.DOC_FREQ;
colsToLoad[1] = Constants.ITEM_ID;
this.load(null, dictionaryFilePath, colsToLoad, sigma, -1);
int[] itemIdList = this.itemIds;
for(int itemId : itemIdList) {
int support = this.docFreqs[this.posOf(itemId)];
fListMap.put(itemId, support);
}
return fListMap;
}
开发者ID:uma-pi1,项目名称:mgfsm,代码行数:24,代码来源:Dictionary.java
示例2: createAndMeasureMahoutMutableIntIntHashMap
import org.apache.mahout.math.map.OpenIntIntHashMap; //导入依赖的package包/类
public static String createAndMeasureMahoutMutableIntIntHashMap(final Object[] data,
int elementCount, int run, MemoryFootprintPreset preset) {
org.apache.mahout.math.map.AbstractIntIntMap mutableYs = new OpenIntIntHashMap();
for (Object o : data) {
for (int i = 0; i < multimapValueSize; i++) {
mutableYs.put((Integer) o, (Integer) i);
}
}
return measureAndReport(mutableYs, "org.apache.mahout.math.map.OpenIntIntHashMap", DataType.MAP,
Archetype.MUTABLE, false, elementCount, run, preset);
}
开发者ID:msteindorfer,项目名称:criterion,代码行数:14,代码来源:CalculateFootprintsHeterogeneous.java
示例3: initCaches
import org.apache.mahout.math.map.OpenIntIntHashMap; //导入依赖的package包/类
private void initCaches() {
this.caches = new OpenIntIntHashMap[getProbes()];
for (int ii = 0; ii < getProbes(); ii++) {
caches[ii] = new OpenIntIntHashMap();
}
}
开发者ID:saradelrio,项目名称:Chi-FRBCS-BigDataCS,代码行数:7,代码来源:CachingContinuousValueEncoder.java
示例4: getCaches
import org.apache.mahout.math.map.OpenIntIntHashMap; //导入依赖的package包/类
protected OpenIntIntHashMap[] getCaches() {
return caches;
}
开发者ID:saradelrio,项目名称:Chi-FRBCS-BigDataCS,代码行数:4,代码来源:CachingContinuousValueEncoder.java
示例5: load
import org.apache.mahout.math.map.OpenIntIntHashMap; //导入依赖的package包/类
public void load(Configuration conf, String fileName, int minSupport) throws IOException {
BufferedReader br = null;
if (conf == null) {
@SuppressWarnings("resource")
FileInputStream fstream = new FileInputStream(fileName);
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
br = new BufferedReader(new InputStreamReader(in));
} else {
FileSystem fs = FileSystem.get(conf);
FSDataInputStream dis = fs.open(new Path(fileName));
br = new BufferedReader(new InputStreamReader(dis));
}
OpenIntIntHashMap parentMap = new OpenIntIntHashMap();
String line = null;
while ((line = br.readLine()) != null) {
String[] splits = line.split("\t");
int itemId = Integer.parseInt(splits[3]);
int itemSupport = Integer.parseInt(splits[2]);
int parentId = Integer.parseInt(splits[4]);
parentMap.put(itemId, parentId);
if (itemSupport >= minSupport) {
items.add(PrimitiveUtils.combine(itemId, itemSupport));
}
itemIdToItemMap.put(itemId, splits[0]);
}
Collections.sort(items, new MyComparator());
parentIds = new int[parentMap.size() + 1];
IntArrayList keyList = parentMap.keys();
for(int i = 0; i < keyList.size(); ++i) {
int item = keyList.get(i);
parentIds[item] = parentMap.get(item);
}
}
开发者ID:uma-pi1,项目名称:lash,代码行数:44,代码来源:Dictionary.java
示例6: setFlistMap
import org.apache.mahout.math.map.OpenIntIntHashMap; //导入依赖的package包/类
public void setFlistMap(OpenIntIntHashMap fListMap){
this.fListMap = fListMap;
}
开发者ID:uma-pi1,项目名称:mgfsm,代码行数:4,代码来源:BfsMiner.java
注:本文中的org.apache.mahout.math.map.OpenIntIntHashMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论