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

Thompson sampling get_satisfaction_from_true_distribution() #2

Open
fedeotto opened this issue Jul 29, 2021 · 0 comments
Open

Thompson sampling get_satisfaction_from_true_distribution() #2

fedeotto opened this issue Jul 29, 2021 · 0 comments

Comments

@fedeotto
Copy link

Hello, in the code you provide for Thompson sampling I don't understand the following:

    def get_satisfaction_from_true_distribution(self):
        s = np.random.normal(self.mu, self.sigma)
        self.n += 1
        self.sum_satisfaction += s
        return s

In the first line we're just returning a value sampled from the true distribution of Restaurant satisfaction, but then why do you write:

        self.n += 1
        self.sum_satisfaction += s

n is not defined in the class variables, raising an error.. and the same holds for sum_satisfaction..

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

No branches or pull requests

1 participant