Package com.guokr.simbase.store

Examples of com.guokr.simbase.store.Recommendation


                for (SimBasisListener listener : listeners) {
                    listener.onVecSetAdded(key(), vkey);
                }
            }
            for (String key : recs.keySet()) {
                Recommendation rec = recs.get(key);
                String vkeySrc = rec.source.key();
                String vkeyTgt = rec.target.key();
                for (SimBasisListener listener : listeners) {
                    listener.onRecAdded(key(), vkeySrc, vkeyTgt);
                }
View Full Code Here


            scoring = new JensenShannonDivergence();
        }

        VectorSet source = vectorSets.get(vkeySource);
        VectorSet target = vectorSets.get(vkeyTarget);
        Recommendation rec = new Recommendation(source, target, scoring, context.getInt("maxlimits"));

        String rkey = rkey(vkeySource, vkeyTarget);
        this.recommendations.put(rkey, rec);

        source.addListener(rec);
        if (target != source) {
            target.addListener(rec);
        }

        if (source.type().equals("dense")) {
            for (int srcVecId : source.ids()) {
                rec.create(srcVecId);
                float[] vector = source.get(srcVecId);
                target.rescore(source.key(), srcVecId, vector, rec);
            }
        } else {
            for (int srcVecId : source.ids()) {
                rec.create(srcVecId);
                int[] vector = source._get(srcVecId);
                target.rescore(source.key(), srcVecId, vector, rec);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.guokr.simbase.store.Recommendation

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.