private Set<String> categories() { return valueToKey.keySet(); }
@Override public Set<K> keySet() { return counts.keySet(); }
private Set<String> categories() { return valueToKey.keySet(); }
/** * @return The list of candidate heavy hitters. Used after running an approximate algorithm * to get candidates for computing exact counts. */ public List<RowSnapshot> getList() { return new ArrayList<RowSnapshot>(this.hMap.keySet()); }
public static Set<String> getFuels() { return ImmutableSet.copyOf(fuelMap.keySet()); }
public static Set<String> getFuels() { return ImmutableSet.copyOf(fuelMap.keySet()); }
public static Set<String> getCoolantFluids() { return ImmutableSet.copyOf(coolantMap.keySet()); }
/** * Method used to filter the table and keep/discard only those rows that match one of the heavy * hitters. * @param schema tells us which columns were used to compare with the heavy hitters. * @param includeSet specifies whether the matching rows are kept or discarded. * @return A table filter for only those rows that match one of the heavy hitters in Schema. */ public RowSnapshotSet.SetTableFilterDescription getFilter(final Schema schema, boolean includeSet) { RowSnapshotSet rss = new RowSnapshotSet(schema, this.hMap.keySet()); return new RowSnapshotSet.SetTableFilterDescription(rss, includeSet); }
@Override protected void trainInternal(List<Item> items, List<ClickData> transactions) { //iterate over all newly published items for (Item item : items) { //if the keywords of the item are not null, create a keyword map an save it if(item.keywords!=null){ //create an empty bitmap of keyword IDs EWAHCompressedBitmap itemKeywords = new EWAHCompressedBitmap(); itemKeywordMap.put(item.id, itemKeywords); //iterate over the item's keywords for (String keyword : item.keywords.keySet()) { //if the keyword is unknown, generate a new INT id for it if(!keywordMap.containsKey(keyword)){ keywordMap.put(keyword, ++currentKeywordCounter); keywordItemMap.put(currentKeywordCounter, new LongOpenHashSet()); } //extract the id of the keyword int keywordInt = keywordMap.get(keyword); //set the bit for this keyword in the item's bitmap itemKeywords.set(keywordInt); //also set the item in the keyword's reverse lookup map keywordItemMap.get(keywordInt).add(item.id); } } } }
transaction.item.keywords = new Object2IntOpenHashMap<>(); for (String keyword : transaction.keywords.keySet()) { transaction.item.keywords.addTo(keyword, transaction.keywords.getInt(keyword));
fw.write( type + "\t" ); Object2IntOpenHashMap<String> wordsForType = wordMap.get( type ); for( String word : wordsForType.keySet() ) { fw.write( word + "\u0001" + wordsForType.get( word ) + "\t" ); for( String word : wordsForType.keySet() ) { fw.write( word + "\u0001" + wordsForType.get( word ) + "\t" );