i implement Thomson Sampling into bandits problem. I want to use an algorithm for domains in an advertising campaign. for example, I have 10 domains to blacklist. if a domain with the highest probability of poor performance is selected and we turn it off, receiving a reward, then for the next iteration we can only choose from 9 domains. how should the code be modified to take into account the decreasing number of hands in each iteration?

my code:

class bandits:
    def __init__(self, arm_probs: list):
        self.arm_probs = arm_probs
        self.n_arms = len(self.arm_probs)
        self.alpha = np.ones(self.n_arms)
        self.beta = np.ones(self.n_arms)
        self.regret = 0

    def evaluate(true_prob: float):
        return 1 if np.random.uniform(0, 1, 1) <= true_prob else 0

    def update_prior(alpha: int, beta: int, reward: int, chosen_arm: int):
        alpha[chosen_arm] += reward
        beta[chosen_arm] += 1 - reward

        return alpha, beta

    def update_regret(regret: int, alpha: int, beta: int, reward: int, chosen_arm: int):
        arm_theta = [alpha / (alpha + beta) for alpha, beta in zip(alpha, beta)]

        if reward == 0:
            if arm_theta[chosen_arm] < max(arm_theta):
                regret += 1 

        return regret

def ThompsonSampling(arm_probs: list, alpha: list, beta: list, regret: int):
    samples = [random.betavariate(alpha[arm_num], beta[arm_num]) for arm_num in range(len(arm_probs))]
    chosen_arm = np.where(samples == np.max(samples))[0][0]
    reward = bandits.evaluate(arm_probs[chosen_arm])
    bandits.update_prior(alpha, beta, reward, chosen_arm)
    regret = bandits.update_regret(regret, alpha, beta, reward, chosen_arm)

    return chosen_arm, reward, regret

and how i run it:

arm_probs = [0.10, 0.40, 0.85, 0.52, 0.61, 0.23, 0.123, 0.234]
iterations = 5000
df_regret = pd.DataFrame(columns = ['iter', 'regret'], dtype = int)
df_reward = pd.DataFrame(columns = ['iter', 'reward'], dtype = int)
arm_choices = {}

for arm in range(len(arm_probs)):
    arm_choices.update({arm:[]})   

env = bandits(arm_probs)
alpha, beta, regret = env.alpha, env.beta, env.regret

for i in range(iterations):
    chosen_arm, reward, regret = ThompsonSampling(arm_probs, alpha, beta, regret)
    df_reward.loc[i] = [i, reward]
    df_regret.loc[i] = [i, regret]
    
    arm_choices[chosen_arm].append(i)


I'm injecting Thomson Sampling into a bandit problem. I want to use bandits and thompson sampling to select a blacklisted candidate from a list of domains for an ad campaign. for exam Include at least 36 hashtags, starting with '#'
user