src/rime/__init__.py
def _mtch_update(self, target_csr, score_mat, valid_mat, name):
        """ assign user/item matches and return evaluation results.
        """
        confs = []
        for m in self.mult:
            if m < 1:
                # lower-bound is interpreted as item min-exposure
                confs.append((self._k1, self._c1 * m, 'lb'))
            else:
                # upper-bound is interpreted as user max-limit
                confs.append((self._k1 * m, self._c1, 'ub'))

        mtch_kw = self.mtch_kw.copy()
        if self.cvx:
            mtch_kw['valid_mat'] = valid_mat
            mtch_kw['prefix'] = f"{name}-{self.online}"
        else:
            mtch_kw['argsort_ij'] = _argsort(score_mat, device=self.device)

        out = []
        for k, c, constraint_type in confs:
            res = evaluate_mtch(
                target_csr, score_mat, k, c, constraint_type=constraint_type,
                cvx=self.cvx, device=self.device,
                item_prior=1 + self.D.item_in_test['_hist_len'].values,
                **mtch_kw
            )
            res.update({'k': k, 'c': c})
            out.append(res)

        return out
 assign user/item matches and return evaluation results.
        
assign user/item matches and return evaluation results.
assign user / item matches and return evaluation results .
def _mtch_update(self, target_csr, score_mat, valid_mat, name):
        confs = []
        for m in self.mult:
            if m < 1:
                confs.append((self._k1, self._c1 * m, 'lb'))
            else:
                confs.append((self._k1 * m, self._c1, 'ub'))
        mtch_kw = self.mtch_kw.copy()
        if self.cvx:
            mtch_kw['valid_mat'] = valid_mat
            mtch_kw['prefix'] = f"{name}-{self.online}"
        else:
            mtch_kw['argsort_ij'] = _argsort(score_mat, device=self.device)
        out = []
        for k, c, constraint_type in confs:
            res = evaluate_mtch(
                target_csr, score_mat, k, c, constraint_type=constraint_type,
                cvx=self.cvx, device=self.device,
                item_prior=1 + self.D.item_in_test['_hist_len'].values,
                **mtch_kw
            )
            res.update({'k': k, 'c': c})
            out.append(res)
        return out
def _mtch_update ( self , target_csr , score_mat , valid_mat , name ) : confs = [ ] for m in self . mult : if m < 1 : confs . append ( ( self . _k1 , self . _c1 * m , 'lb' ) ) else : confs . append ( ( self . _k1 * m , self . _c1 , 'ub' ) ) mtch_kw = self . mtch_kw . copy ( ) if self . cvx : mtch_kw [ 'valid_mat' ] = valid_mat mtch_kw [ 'prefix' ] = f"{name}-{self.online}" else : mtch_kw [ 'argsort_ij' ] = _argsort ( score_mat , device = self . device ) out = [ ] for k , c , constraint_type in confs : res = evaluate_mtch ( target_csr , score_mat , k , c , constraint_type = constraint_type , cvx = self . cvx , device = self . device , item_prior = 1 + self . D . item_in_test [ '_hist_len' ] . values , ** mtch_kw ) res . update ( { 'k' : k , 'c' : c } ) out . append ( res ) return out
assign user/item matches and return evaluation results.
assign user / item matches and return evaluation results .
""" assign user/item matches and return evaluation results.
        """ # lower-bound is interpreted as item min-exposure # upper-bound is interpreted as user max-limit
self
target_csr
score_mat
valid_mat
name