Examples of finishVector()


Examples of org.grouplens.lenskit.util.TopNScoredItemAccumulator.finishVector()

        TopNScoredItemAccumulator accumulator = new TopNScoredItemAccumulator(n);
        for (VectorEntry e : v.view(VectorEntry.State.SET)) {
            accumulator.put(e.getKey(), e.getValue());
        }
        MutableSparseVector truncated = accumulator.finishVector();

        // retain only the truncated keys
        v.keySet().retainAll(truncated.keySet());
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.