isoexp/contextual/contextual_linucb.py [99:109]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        choice = np.argmax(ucb)  # choose the highest
        return choice

    def update(self, context, a_t, r_t):

        self.inv_design_matrices[a_t] = self.inv_design_matrices[a_t] - \
                                        np.dot(self.inv_design_matrices[a_t], np.dot(np.outer(context, context),
                                                                                    self.inv_design_matrices[a_t])) \
                                        / (1. + np.dot(context.T, np.dot(self.inv_design_matrices[a_t], context)))
        self.bs[a_t] += r_t * context
        self.n_samples[a_t] += 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



isoexp/contextual/contextual_linucb.py [155:165]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        choice = np.argmax(ucb)  # choose the highest
        return choice

    def update(self, context, a_t, r_t):

        self.inv_design_matrices[a_t] = self.inv_design_matrices[a_t] - \
                                        np.dot(self.inv_design_matrices[a_t], np.dot(np.outer(context, context),
                                                                                    self.inv_design_matrices[a_t])) \
                                        / (1. + np.dot(context.T, np.dot(self.inv_design_matrices[a_t], context)))
        self.bs[a_t] += r_t * context
        self.n_samples[a_t] += 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



