Skip to content

Simplify BanditData model - #1333

Merged
tomrf1 merged 3 commits into
mainfrom
tf-simplify-bandit-data
Apr 17, 2025
Merged

tomrf1 merged 3 commits into
mainfrom
tf-simplify-bandit-data

Conversation

@tomrf1

@tomrf1 tomrf1 commented Apr 17, 2025

Copy link
Copy Markdown
Member

The bandit data is fetched and cached regularly.
Originally this data was only used by the epsilon-greedy algorithm, which only requires the best variants (those with the highest mean). And so for efficiency the model just had a bestVariants array:

export interface BanditData {
    testName: string;
    bestVariants: BanditVariantData[]; // will contain more than 1 variant if there is a tie
}

We later added the "roulette" algorithm, which requires the means for all variants, so we added a variants field to the model:

export interface BanditData {
    testName: string;
    bestVariants: BanditVariantData[]; // will contain more than 1 variant if there is a tie
    variants: BanditVariantData[];
}

This PR simplifies the model to:

export interface BanditData {
    testName: string;
    sortedVariants: BanditVariantData[];  // sorted by mean, highest first
}

I'm doing this ahead of some work on simulation for selection methods.

@tomrf1
tomrf1 marked this pull request as ready for review April 17, 2025 08:25
@tomrf1
tomrf1 requested a review from a team April 17, 2025 08:25

@LAKSHMIRPILLAI LAKSHMIRPILLAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼 Great

@tomrf1
tomrf1 merged commit 5870f3b into main Apr 17, 2025
@tomrf1
tomrf1 deleted the tf-simplify-bandit-data branch April 17, 2025 08:52
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 this pull request may close these issues.

2 participants