예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MahoutLazyListPredictionContextBase{TQueryEntity,TResultEntity}"/> class.
 /// </summary>
 /// <param name="recommender">The recommender used to actually perform the queries.</param>
 /// <param name="maxPredictionListSize">The maximum size of the prediction list.</param>
 protected MahoutLazyListPredictionContextBase(
     MahoutRecommender <TInstanceSource> recommender, int maxPredictionListSize)
     : base(maxPredictionListSize)
 {
     this.Recommender = recommender;
     this.Queries     = new Dictionary <TQueryEntity, IEnumerable <TResultEntity> >();
 }
        /// <summary>
        /// Creates an instance of the Mahout recommender using the settings from this configuration element.
        /// </summary>
        /// <param name="mapping">The mapping for the recommender being created.</param>
        /// <returns>An instance of the Mahout recommender.</returns>
        public override IRecommender <SplitInstanceSource <RecommenderDataset>, User, Item, int, RatingDistribution, DummyFeatureSource> Create(
            IStarRatingRecommenderMapping <SplitInstanceSource <RecommenderDataset>, RatedUserItem, User, Item, int, DummyFeatureSource, Vector> mapping)
        {
            var recommender = MahoutRecommender <SplitInstanceSource <RecommenderDataset> > .Create(mapping);

            recommender.Settings.RatingSimilarity                 = this.RatingSimilarity.Value;
            recommender.Settings.RatingPredictionAlgorithm        = this.RatingPredictionAlgorithm.Value;
            recommender.Settings.MissingRatingPredictionAlgorithm = this.MissingRatingPredictionAlgorithm.Value;
            recommender.Settings.UserNeighborhoodSize             = this.UserNeighborhoodSize.Value;
            recommender.Settings.TraitCount     = this.TraitCount.Value;
            recommender.Settings.IterationCount = this.IterationCount.Value;

            return(recommender);
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LazyFindRelatedItemsContext"/> class.
 /// </summary>
 /// <param name="recommender">The recommender used to actually perform the queries.</param>
 /// <param name="maxRelatedItemCount">The maximum number of related items to return for every item.</param>
 public LazyFindRelatedItemsContext(
     MahoutRecommender <TInstanceSource> recommender, int maxRelatedItemCount)
     : base(recommender, maxRelatedItemCount)
 {
 }