(self, target, clf_idx)
return self._plot_curves[target, clf_idx]
Return a set of functions `plot_curves` generating plot curves.
Return a set of functions `plot_curves` generating plot curves.
Return a set of functions plot_curves generating plot curves .
def plot_curves(self, target, clf_idx):
        """Return a set of functions `plot_curves` generating plot curves."""
        def generate_pens(basecolor):
            pen = QPen(basecolor, 1)
            pen.setCosmetic(True)

            shadow_pen = QPen(pen.color().lighter(160), 2.5)
            shadow_pen.setCosmetic(True)
            return pen, shadow_pen

        data = self.curve_data(target, clf_idx)

        if (target, clf_idx) not in self._plot_curves:
            pen, shadow_pen = generate_pens(self.colors[clf_idx])
            name = self.classifier_names[clf_idx]
            @once
            def merged():
                return plot_curve(
                    data.merged, pen=pen, shadow_pen=shadow_pen, name=name)
            @once
            def folds():
                return [plot_curve(fold, pen=pen, shadow_pen=shadow_pen)
                        for fold in data.folds]
            @once
            def avg_vert():
                return plot_avg_curve(data.avg_vertical, pen=pen,
                                      shadow_pen=shadow_pen, name=name)
            @once
            def avg_thres():
                return plot_avg_curve(data.avg_threshold, pen=pen,
                                      shadow_pen=shadow_pen, name=name)

            self._plot_curves[target, clf_idx] = PlotCurves(
                merge=merged, folds=folds,
                avg_vertical=avg_vert, avg_threshold=avg_thres
            )

        return self._plot_curves[target, clf_idx]
def plot_curves ( self , target , clf_idx ) : def generate_pens ( basecolor ) : pen = QPen ( basecolor , 1 ) pen . setCosmetic ( True ) shadow_pen = QPen ( pen . color ( ) . lighter ( 160 ) , 2.5 ) shadow_pen . setCosmetic ( True ) return pen , shadow_pen data = self . curve_data ( target , clf_idx ) if ( target , clf_idx ) not in self . _plot_curves : pen , shadow_pen = generate_pens ( self . colors [ clf_idx ] ) name = self . classifier_names [ clf_idx ] @ once def merged ( ) : return plot_curve ( data . merged , pen = pen , shadow_pen = shadow_pen , name = name ) @ once def folds ( ) : return [ plot_curve ( fold , pen = pen , shadow_pen = shadow_pen ) for fold in data . folds ] @ once def avg_vert ( ) : return plot_avg_curve ( data . avg_vertical , pen = pen , shadow_pen = shadow_pen , name = name ) @ once def avg_thres ( ) : return plot_avg_curve ( data . avg_threshold , pen = pen , shadow_pen = shadow_pen , name = name ) self . _plot_curves [ target , clf_idx ] = PlotCurves ( merge = merged , folds = folds , avg_vertical = avg_vert , avg_threshold = avg_thres ) return self . _plot_curves [ target , clf_idx ]