@zaleslaw
I have a Map<String, Map&lt;String, Long>> where outer map is userId ->
hitsMap and inner hitsMap is domain -> hits. So I need to do domain vectors
for each of the user. Cache populated through Cache.put operation.

private Map<String, Map&lt;String, Long>> hits;
<...>
        storageName = "profile-clustering-" + LocalDateTime.now();
        IgniteCache<String, double[]> cache =
ignite.getOrCreateCache(storageName);
<...>
        AtomicInteger ai = new AtomicInteger(0);
        hits.forEach((profileId, hit) -> {
            List<Long> features = new ArrayList<>();
            // surrogate label for now
            features.add(Long.valueOf(ai.incrementAndGet()));
            ai.compareAndSet(5, 0);
            sortedDomains.forEach(d -> features.add(hit.getOrDefault(d,
0L)));
            double[] doubles = features.stream().mapToDouble(p ->
p).toArray();
            if (profileId != null && !profileId.isEmpty()){
                cache.put(profileId, doubles);
            }
        });

No specific affinity function defined, total dataset contains ~3.1k users &
~8k domains.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to