src/rime/util/plotting.py
def plot_mtch_results(self, logy=True):
    """ self is an instance of Experiment or ExperimentResult """
    fig, ax = plt.subplots(1, 2, figsize=(7, 2.5))
    df = [self.get_mtch_(k=self._k1), self.get_mtch_(c=self._c1)]

    xname = [f'ItemRec Prec@{self._k1}', f'UserRec Prec@{self._c1}']
    yname = ['item_ppl', 'user_ppl']

    for ax, df, xname, yname in zip(ax, df, xname, yname):
        ax.set_prop_cycle('color', [
            plt.get_cmap('tab20')(i / 20) for i in range(20)])
        if df is not None:
            ax.plot(
                df.loc['prec'].unstack().values.T,
                df.loc[yname].unstack().values.T,
                '.-',
            )
        ax.set_xlabel(xname)
        ax.set_ylabel(yname)
        if logy:
            ax.set_yscale('log')
        ax.axhline(getattr(self, yname + '_baseline'), ls='-.', color='gray')
    fig.legend(
        df.loc['prec'].unstack().index.values.tolist() + [yname + '_baseline'],
        bbox_to_anchor=(0.1, 0.9, 0.8, 0), loc=3, ncol=3,
        mode="expand", borderaxespad=0.)
    fig.subplots_adjust(wspace=0.25)
    return fig
 self is an instance of Experiment or ExperimentResult 
self is an instance of Experiment or ExperimentResult
self is an instance of Experiment or ExperimentResult
def plot_mtch_results(self, logy=True):
    fig, ax = plt.subplots(1, 2, figsize=(7, 2.5))
    df = [self.get_mtch_(k=self._k1), self.get_mtch_(c=self._c1)]
    xname = [f'ItemRec Prec@{self._k1}', f'UserRec Prec@{self._c1}']
    yname = ['item_ppl', 'user_ppl']
    for ax, df, xname, yname in zip(ax, df, xname, yname):
        ax.set_prop_cycle('color', [
            plt.get_cmap('tab20')(i / 20) for i in range(20)])
        if df is not None:
            ax.plot(
                df.loc['prec'].unstack().values.T,
                df.loc[yname].unstack().values.T,
                '.-',
            )
        ax.set_xlabel(xname)
        ax.set_ylabel(yname)
        if logy:
            ax.set_yscale('log')
        ax.axhline(getattr(self, yname + '_baseline'), ls='-.', color='gray')
    fig.legend(
        df.loc['prec'].unstack().index.values.tolist() + [yname + '_baseline'],
        bbox_to_anchor=(0.1, 0.9, 0.8, 0), loc=3, ncol=3,
        mode="expand", borderaxespad=0.)
    fig.subplots_adjust(wspace=0.25)
    return fig
def plot_mtch_results ( self , logy = True ) : fig , ax = plt . subplots ( 1 , 2 , figsize = ( 7 , 2.5 ) ) df = [ self . get_mtch_ ( k = self . _k1 ) , self . get_mtch_ ( c = self . _c1 ) ] xname = [ f'ItemRec Prec@{self._k1}' , f'UserRec Prec@{self._c1}' ] yname = [ 'item_ppl' , 'user_ppl' ] for ax , df , xname , yname in zip ( ax , df , xname , yname ) : ax . set_prop_cycle ( 'color' , [ plt . get_cmap ( 'tab20' ) ( i / 20 ) for i in range ( 20 ) ] ) if df is not None : ax . plot ( df . loc [ 'prec' ] . unstack ( ) . values . T , df . loc [ yname ] . unstack ( ) . values . T , '.-' , ) ax . set_xlabel ( xname ) ax . set_ylabel ( yname ) if logy : ax . set_yscale ( 'log' ) ax . axhline ( getattr ( self , yname + '_baseline' ) , ls = '-.' , color = 'gray' ) fig . legend ( df . loc [ 'prec' ] . unstack ( ) . index . values . tolist ( ) + [ yname + '_baseline' ] , bbox_to_anchor = ( 0.1 , 0.9 , 0.8 , 0 ) , loc = 3 , ncol = 3 , mode = "expand" , borderaxespad = 0. ) fig . subplots_adjust ( wspace = 0.25 ) return fig
self is an instance of Experiment or ExperimentResult
self is an instance of Experiment or ExperimentResult
""" self is an instance of Experiment or ExperimentResult """
self
logy