Package it.unimi.dsi.fastutil.longs

Examples of it.unimi.dsi.fastutil.longs.Long2ObjectMap


                vchan.set(ids.get(i), chan.values.get(i));
            }
        }

        for (TypedChannelStorage<?> chan: typedChannels.values()) {
            Long2ObjectMap vchan = msv.getOrAddChannel(chan.symbol);
            for (int i = 0; i < size; i++) {
                vchan.put(ids.get(i), chan.values.get(i));
            }
        }

        return msv.freeze();
    }
View Full Code Here


        logger.info("predicting {} items", items.size());
        Symbol pchan = getPrintChannel();
        Stopwatch timer = Stopwatch.createStarted();
        SparseVector preds = pred.predict(user, items);
        Long2ObjectMap channel = null;
        if (pchan != null) {
            for (TypedSymbol sym: preds.getChannelSymbols()) {
                if (sym.getRawSymbol().equals(pchan)) {
                    channel = preds.getChannel(sym);
                }
            }
        }
        for (VectorEntry e: preds) {
            System.out.format("  %d: %.3f", e.getKey(), e.getValue());
            if (channel != null) {
                System.out.format(" (%s)", channel.get(e.getKey()));
            }
            System.out.println();
        }
        timer.stop();
        logger.info("predicted for {} items in {}", items.size(), timer);
View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.longs.Long2ObjectMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.