Skip to content

Thompson sampling get_satisfaction_from_true_distribution() #2

@fedeotto

Description

@fedeotto

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..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions