Exemplo n.º 1
0
        // try two different method, inner dot or cos
        private static double GetCwobScore(DoubleVec vec1, DoubleVec vec2)
        {
            //double score = DoubleVecUtil.GetInnerDot(vec1, vec2);
            // normailzed score between -1.0 to 1.0
            double score = DoubleVecUtil.GetCosineSimilarity(vec1, vec2);

            return(score);
        }
Exemplo n.º 2
0
        // private method
        private static double GetSimilarityScore(DoubleVec vec1, DoubleVec vec2)
        {
            double score = DoubleVecUtil.GetCosineSimilarity(vec1, vec2);

            // set the min. to 0.0
            score = (score <= 0.0 ? 0.0d : score);
            return(score);
        }
Exemplo n.º 3
0
        // use cosineSimilarity instead of inner dot
        private static double GetInnerDotScore(DoubleVec vec1, DoubleVec vec2)
        {
            double score = DoubleVecUtil.GetInnerDot(vec1, vec2);

            // set the min. to 0.0
            // it seems -score is useful for split ....
            //score = (score <= 0.0?0.0d:score);
            return(score);
        }