/// <summary>
        /// Creates an instance of the VW 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 VW 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 = VowpalWabbitRecommender <SplitInstanceSource <RecommenderDataset> > .Create(mapping);

            recommender.Settings.TraitCount        = this.TraitCount.Value;
            recommender.Settings.BitPrecision      = this.BitPrecision.Value;
            recommender.Settings.LearningRate      = this.LearningRate.Value;
            recommender.Settings.LearningRateDecay = this.LearningRateDecay.Value;
            recommender.Settings.PassCount         = this.PassCount.Value;
            recommender.Settings.L1Regularization  = this.L1Regularization.Value;
            recommender.Settings.L2Regularization  = this.L2Regularization.Value;
            recommender.Settings.UseUserFeatures   = this.UseUserFeatures.Value;
            recommender.Settings.UseItemFeatures   = this.UseItemFeatures.Value;

            return(recommender);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LazyRecommendationContext"/> class.
 /// </summary>
 /// <param name="recommender">The recommender.</param>
 /// <param name="recommendationCount">The maximum number of items to recommend.</param>
 public LazyRecommendationContext(
     VowpalWabbitRecommender <TInstanceSource> recommender, int recommendationCount)
     : base(recommendationCount)
 {
     this.recommender = recommender;
 }