示例#1
0
        static WeightedRecommendationEngineCollection CreateRecommendationEngines(string instance)
        {
            var engines = new WeightedRecommendationEngineCollection();

            foreach (var behaviorType in BehaviorTypes.All())
            {
                var featureBuilder = new BehaviorBasedFeatureBuilder(() =>
                {
                    var store = BehaviorStores.Get(instance, behaviorType);
                    return(store.GetRecentBehaviors(50));
                });

                var engine = new FeatureBasedRecommendationEngine(featureBuilder, RelatedItemsProviders.GetProviders(instance));
                engines.Add(engine, 1f);
            }

            return(engines);
        }
        static WeightedRecommendationEngineCollection CreateRecommendationEngines(string instance)
        {
            var engines = new WeightedRecommendationEngineCollection();

            foreach (var behaviorType in BehaviorTypes.All())
            {
                var featureBuilder = new BehaviorBasedFeatureBuilder(() =>
                {
                    var store = BehaviorStores.Get(instance, behaviorType);
                    return store.GetRecentBehaviors(50);
                });

                var engine = new FeatureBasedRecommendationEngine(featureBuilder, RelatedItemsProviders.GetProviders(instance));
                engines.Add(engine, 1f);
            }

            return engines;
        }