Ejemplo n.º 1
0
        public double SharedWordRatio(WeightedItemVector <T> other)
        {
            var topThis  = this._itemWeights.OrderByDescending(n => n.Value).Select(n => n.Key).Take(5);
            var topOther = other._itemWeights.OrderByDescending(n => n.Value).Select(n => n.Key).Take(5);

            return(topThis.Intersect(topOther).Count() / (double)topThis.Union(topOther).Count());
        }
Ejemplo n.º 2
0
 public double DotProduct(WeightedItemVector <T> b)
 {
     return(this * b);
 }