Example #1
0
        public GenericItemSimilarity(ItemSimilarity otherSimilarity, DataModel dataModel, int maxToKeep)
        {
            this.similarityMaps      = new FastByIDMap <FastByIDMap <double?> >();
            this.similarItemIDsIndex = new FastByIDMap <FastIDSet>();
            long[] itemIDs = GenericUserSimilarity.longIteratorToList(dataModel.getItemIDs());
            DataModelSimilaritiesIterator allSimilarities = new DataModelSimilaritiesIterator(otherSimilarity, itemIDs);

            this.initSimilarityMaps(TopItems.getTopItemItemSimilarities(maxToKeep, allSimilarities).GetEnumerator());
        }
Example #2
0
 public GenericItemSimilarity(IEnumerable <ItemItemSimilarity> similarities, int maxToKeep)
 {
     this.similarityMaps      = new FastByIDMap <FastByIDMap <double?> >();
     this.similarItemIDsIndex = new FastByIDMap <FastIDSet>();
     this.initSimilarityMaps(TopItems.getTopItemItemSimilarities(maxToKeep, similarities.GetEnumerator()).GetEnumerator());
 }