示例#1
0
        public RecommendationFacetStorageWorker(ITableStoreFactory tableStoreFactory, IXdbContext xdbContext, IReadOnlyDictionary <string, string> options)
        {
            _tableName = options[OptionTableName];
            var schemaName = options[OptionSchemaName];

            _tableStore = tableStoreFactory.Create(schemaName);
            _xdbContext = xdbContext;
        }
示例#2
0
 public RfmTrainingWorker(
     ITableStoreFactory tableStoreFactory,
     IServiceProvider provider,
     ILogger <RfmTrainingWorker> logger,
     AllowedModelsDictionary modelsDictionary,
     IReadOnlyDictionary <string, string> options,
     IServiceProvider serviceProvider)
     : this(tableStoreFactory, provider, logger, modelsDictionary, RfmTrainingWorkerOptionsDictionary.Parse(options), serviceProvider)
 {
 }
示例#3
0
        public MovieRecommendationWorker(ITableStoreFactory tableStoreFactory, IMovieRecommendationsProvider movieRecommendationsProvider, IReadOnlyDictionary <string, string> options)
        {
            _sourceTableName = options[OptionSourceTableName];
            _targetTableName = options[OptionTargetTableName];
            _limit           = int.Parse(options[OptionLimit]);

            _movieRecommendationsProvider = movieRecommendationsProvider;

            var schemaName = options[OptionSchemaName];

            _tableStore = tableStoreFactory.Create(schemaName);
        }
示例#4
0
        public ProductRecommendationWorker(ITableStoreFactory tableStoreFactory, ILogger logger, IReadOnlyDictionary <string, string> options)
        {
            _sourceTableName = options[OptionSourceTableName];
            _targetTableName = options[OptionTargetTableName];
            _limit           = int.Parse(options[OptionLimit]);

            var schemaName = options[OptionSchemaName];

            _tableStore = tableStoreFactory.Create(schemaName);

            _logger = logger;
        }
示例#5
0
 public RfmTrainingWorker(
     ITableStoreFactory tableStoreFactory,
     IServiceProvider provider,
     ILogger <RfmTrainingWorker> logger,
     AllowedModelsDictionary modelsDictionary,
     RfmTrainingWorkerOptionsDictionary options,
     IServiceProvider serviceProvider)
 {
     _tableStore      = tableStoreFactory.Create(options.SchemaName);
     _options         = options;
     _logger          = logger;
     _model           = modelsDictionary.CreateModel <Interaction>(provider, options.ModelType, options.ModelOptions);
     _serviceProvider = serviceProvider;
 }
示例#6
0
        public ContactModel(IReadOnlyDictionary <string, string> options, IMLNetService mlNetService, ITableStoreFactory tableStoreFactory) : base(tableStoreFactory)
        {
            _mlNetService      = mlNetService;
            _tableStoreFactory = tableStoreFactory;

            Projection = Sitecore.Processing.Engine.Projection.Projection.Of <Contact>().CreateTabular(
                "ContactModel",
                cfg => cfg
                .Key("ContactId", c => c.Id)
                .Attribute("Enabled", c => c.GetFacet <RfmContactFacet>() == null ? 0 : 1)
                .Attribute("R", c => c.GetFacet <RfmContactFacet>() == null ? 0 : c.GetFacet <RfmContactFacet>().R)
                .Attribute("F", c => c.GetFacet <RfmContactFacet>() == null ? 0 : c.GetFacet <RfmContactFacet>().F)
                .Attribute("M", c => c.GetFacet <RfmContactFacet>() == null ? 0 : c.GetFacet <RfmContactFacet>().M)
                .Attribute("Recency", c => c.GetFacet <RfmContactFacet>() == null ? 0 : c.GetFacet <RfmContactFacet>().Recency)
                .Attribute("Frequency", c => c.GetFacet <RfmContactFacet>() == null ? 0 : c.GetFacet <RfmContactFacet>().Frequency)
                .Attribute("Monetary", c => c.GetFacet <RfmContactFacet>() == null ? 0 : c.GetFacet <RfmContactFacet>().Monetary)
                .Attribute("Email", c => c.Emails()?.PreferredEmail?.SmtpAddress, nullable: true));
        }
示例#7
0
        public PurchaseInteractionModel(IReadOnlyDictionary <string, string> options, IMLNetService mlNetService, ITableStoreFactory tableStoreFactory) : base(tableStoreFactory)
        {
            _tableStoreFactory = tableStoreFactory;
            _mlNetService      = mlNetService;

            Projection = Sitecore.Processing.Engine.Projection.Projection.Of <Interaction>()
                         .CreateTabular("PurchaseOutcome",
                                        interaction => interaction.Events.OfType <PurchaseOutcome>().Select(p =>
                                                                                                            new
            {
                Purchase = p,
                interaction.IpInfo()?.Country
            }),
                                        cfg => cfg.Key("Id", x => x.Purchase.Id)
                                        .Attribute(nameof(PurchaseInvoice.Quantity), x => x.Purchase.Quantity)
                                        .Attribute(nameof(PurchaseInvoice.TimeStamp), x => x.Purchase.Timestamp)
                                        .Attribute(nameof(PurchaseInvoice.Price), x => x.Purchase.UnitPrice)
                                        .Attribute(nameof(PurchaseInvoice.StockCode), x => x.Purchase.ProductId)
                                        .Attribute(nameof(PurchaseInvoice.Country), x => x.Country, true)
                                        );
        }
 public Functions(ITableStoreFactory tableFactory, IConfiguration config)
 {
     _table = tableFactory.CreateTableStore <LogEntity>("ExampleLogs", config["AzureWebJobsStorage"]);
     _table.CreateTable();
 }
 public BusinessScoreService(ITableStoreFactory tableStoreFactory)
     : base(tableStoreFactory)
 {
     _tableStoreFactory   = tableStoreFactory;
     _rfmCalculateService = new RfmCalculateService();
 }