Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Price Floors Module: Multiple Floor Model Selection #5339

Closed
bszekely1 opened this issue Jun 5, 2020 · 1 comment · Fixed by #5390
Closed

Price Floors Module: Multiple Floor Model Selection #5339

bszekely1 opened this issue Jun 5, 2020 · 1 comment · Fixed by #5390
Assignees

Comments

@bszekely1
Copy link

bszekely1 commented Jun 5, 2020

Type of issue

Intent to implement

Description

The intent of this ticket is to provide a method for Floor Providers to apply and A/B test different models when implemented in the Prebid Floors Module. Today Floor Providors are limited to applying one model per URL fetch. To apply more than one model per user session today, a Floor Provider would need to reload new fetch URLs for each model, controling the sampling rate and which file to load outside of prebid logic.

Goals

  • Define a flexible method for Floor Providers to A/B test different models using the Prebid Floors Module
  • Mitigate any additional latency on the existing fetch model of the Floors Module

General requirements

  1. The new floor solution should be backwards compatible with exiting Floor Providers, and ad unit or setConfig floors
  2. Floors Provider should be able to supply one or more models with their own set of schema fields and values in the new floors schema
  3. Floor Providers should be able to specificy the frequency of each model should be applied by a sampling weight
  4. Sampling weights are applied at the auction level to all ad slots after skipRate
  5. The sampling weights should be recalculated (i.e. decide which model to select if there is more than one model) once the fetch or setConfig is applied to the current auction
  6. The application of floors (signaling and enforcement) should remain the same using the original floors schema or new one
  7. Weights of model selection should be normalized to 1 to allow Floor Providers to supply their own weights without having to calculate to 100%
  8. When using schema version 2, a weight should be provided for each model, otherwise the floors module will not utilize the floors data set (i.e. other floors can potentially be used if valid)
  9. Schema 2 can be applied run-time in either fetch or setConfig, not within adUnits
  10. The following attributes should be applied at the root level and model level where the model level attribute overrides the root level one:
    • skipRate
    • currency

Proposed Design

New Attributes

Field Name Type Description
floorsSchemaVersion int Describes the version of the schema to allow for backwards and future proofing for multiple schemas
modelGroups object Object to store the different models to apply per auction
modelGroups.modelWeight int The sampling factor determing when the model should be applied. Weights are normalized to 1.

Schema Validation Tool

The goal here is to provide a tool for Floor Providers to validate rules against a particular schema. The validation schema tool should be an HTML page to signal if a supplied rules file is valid. If the file is invalid, it should indicate where the error is.

Weights Normalization Algorithm

Model weights are supplied by the Floors Providers to determine what percentage of auctions (after skipRate has selected the Floors Module select a floor) each model should be applied at. To aide in ease of implementation, the Floors Module will normalize the weights using the following algorithm:

ModelWeight / (sum of all modelWeights)

Example weights:

normalized weights in a three model mode:

Raw weights
Model1: 25
Model2: 25
Model3: 30

Normalized weights
Model1: 0.3125 dervied by: 25/(25+25+30)
Model2: 0.3125 dervied by: 25/(25+25+30)
Model3: 0.375 derived by: 30/(25+25+30)
Total weight: 1 derived by: 0.3125 + 0.3125 + 0.375

Example JSON Floors File:

Schema Version 2, multiple model mode with different schema.fields for each model



{ 
    "currency": "EU",
    "skipRate": 20,
    "floorsSchemaVersion":2,
    "modelGroups": [
        {
            "modelWeight":25,
            "modelVersion": "Model1",
            "schema": {
                "fields": [ "domain", "gptSlot", "mediaType", "size" ]
            },
            "values": {
                "www.publisher.com|/1111/homepage/top-banner|banner|728x90": 1.00,
                "www.publisher.com|/1111/homepage/top-rect|banner|300x250": 1.20,
                "www.publisher.com|/1111/homepage/top-rect|banner|300x600": 1.80,
                ...
                "www.domain.com|/1111/homepage/top-banner|banner|728x90": 2.11
                ...
                "www.publisher.com|*|*|*": 0.80,
            },
            "default": 0.75
        },
        {
            "modelWeight": 25,
            "modelVersion": "Model2",
            "schema": {
                "fields": [ "domain", "mediaType", "size" ]
            },
            "values": {
                "www.publisher.com|banner|728x90": 1.00,
                "www.publisher.com|banner|300x250": 1.20,
                "www.publisher.com|banner|300x600": 1.80,
                ...
                "www.domain.com|banner|728x90": 2.11
                ...
                "www.publisher.com|*|*|*": 0.80,
            },
            "default": 0.75
        },
        {
            "modelWeight": 30,
            "modelVersion": "Model3",
            "schema": {
                "fields": [ "gptSlot", "mediaType", "size" ]
            },
            "values": {
                "/1111/homepage/top-banner|banner|728x90": 1.00,
                "/1111/homepage/top-rect|banner|300x250": 1.20,
                "/1111/homepage/top-rect|banner|300x600": 1.80,
                ...
                "/1111/homepage/top-banner|banner|728x90": 2.11
                ...
                "*|banner|*": 0.80,
            },
            "default": 0.75
        }
    ]
    
}

Out of Scope

Other information

This ticket is related to the Floors Module:

@robertrmartinez
Copy link
Collaborator

#5390

@robertrmartinez robertrmartinez linked a pull request Jun 23, 2020 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants