(self, title=None, x_shift=None, start_point=None, plot_interval=1,
                             std_area=False, std_alpha=0.3, show=True, saving_path='.')
plotting the performance curves.

        Parameters
        ----------
        title: str, optioanl (default=None)
            The tile of the figure.

        x_shift: float, optional (default=None)
            The shift value of x_axis.
            For example, the original x_axis is np.arange(0,100,1), x_shift = 1,
            then the new x_axis will be np.arange(1,101,1)

        start_point: float, optional (default=None)
            The value of start point. This value will added before the first data
            point for all methods. If not provided, an infer is attempted.

        plot_interval: int, optional (default=1)
            The interval (x_axis) of each two data point.
            Default is 1, which means plot each data passed to the analyser.

        std_area: bool, optional (default=False)
            Whether to show the std values of the performance after each query.

        std_alpha: float, optional (default=0.3)
            The alpha value of the std shaded area.
            The smaller the value, the lighter the color.

        show: bool, optional (default=True)
            Whether to show the figure.
            If False, it will return the matplotlib.pyplot object directly.

        saving_path: str, optional (default='.')
            The path to save the image.
            Passing None to disable the saving.

        Returns
        -------
        plt: {matplotlib.pyplot, None}
            If passing `show=False`, the matplot object will be returned.
            Else, None will be returned.
plotting the performance curves.
plotting the performance curves .
def plot_learning_curves(self, title=None, x_shift=None, start_point=None, plot_interval=1,
                             std_area=False, std_alpha=0.3, show=True, saving_path='.'):
        """plotting the performance curves.

        Parameters
        ----------
        title: str, optioanl (default=None)
            The tile of the figure.

        x_shift: float, optional (default=None)
            The shift value of x_axis.
            For example, the original x_axis is np.arange(0,100,1), x_shift = 1,
            then the new x_axis will be np.arange(1,101,1)

        start_point: float, optional (default=None)
            The value of start point. This value will added before the first data
            point for all methods. If not provided, an infer is attempted.

        plot_interval: int, optional (default=1)
            The interval (x_axis) of each two data point.
            Default is 1, which means plot each data passed to the analyser.

        std_area: bool, optional (default=False)
            Whether to show the std values of the performance after each query.

        std_alpha: float, optional (default=0.3)
            The alpha value of the std shaded area.
            The smaller the value, the lighter the color.

        show: bool, optional (default=True)
            Whether to show the figure.
            If False, it will return the matplotlib.pyplot object directly.

        saving_path: str, optional (default='.')
            The path to save the image.
            Passing None to disable the saving.

        Returns
        -------
        plt: {matplotlib.pyplot, None}
            If passing `show=False`, the matplot object will be returned.
            Else, None will be returned.
        """
        assert len(self._data_extracted) > 0
        if self._is_all_stateio:
            self._check_plotting()
        plot_interval = int(round(plot_interval))

        # plotting
        for i in self._data_extracted.keys():
            points = np.mean(self._data_extracted[i], axis=0)
            ori_ponits_len = len(points)
            if std_area:
                std_points = np.std(self._data_extracted[i], axis=0)
            if plot_interval != 1:
                points = np.asarray([points[point_ind] for point_ind in range(ori_ponits_len) if point_ind % plot_interval == 0])
                if std_area:
                    std_points = np.asarray([std_points[point_ind] for point_ind in range(len(std_points)) if point_ind % plot_interval == 0])
            if x_shift is None:
                if not self._is_all_stateio or self._data_summary[i].ip is None:
                    x_shift = 1
                else:
                    x_shift = 0
            if start_point is not None:
                x_shift = 0
                plt.plot(np.arange(ori_ponits_len+1, step=plot_interval) + x_shift, [start_point] + list(points), label=i)
                if std_area:
                    plt.fill_between(np.arange(ori_ponits_len, step=plot_interval) + x_shift + 1, points - std_points, points + std_points,
                                     interpolate=True, alpha=std_alpha)
            else:
                plt.plot(np.arange(ori_ponits_len, step=plot_interval) + x_shift, points, label=i)
                if std_area:
                    plt.fill_between(np.arange(ori_ponits_len, step=plot_interval) + x_shift, points - std_points, points + std_points,
                                     interpolate=True, alpha=std_alpha)

        # axis & title
        plt.legend(fancybox=True, framealpha=0.5)
        plt.xlabel("Number of queries")
        plt.ylabel("Performance")
        if title is not None:
            plt.title(str(title))

        # saving
        if saving_path is not None:
            saving_path = os.path.abspath(saving_path)
            if os.path.isdir(saving_path):
                try:
                    plt.savefig(os.path.join(saving_path, 'alipy_plotting.jpg'))
                except:
                    plt.savefig(os.path.join(saving_path, 'alipy_plotting.pdf'))
            else:
                plt.savefig(saving_path)
        if show:
            try:
                # show before draw will raise an error in some versions of matplotlib
                plt.show()
            except:
                plt.draw()
                plt.show()
        else:
            return plt
def plot_learning_curves ( self , title = None , x_shift = None , start_point = None , plot_interval = 1 , std_area = False , std_alpha = 0.3 , show = True , saving_path = '.' ) : assert len ( self . _data_extracted ) > 0 if self . _is_all_stateio : self . _check_plotting ( ) plot_interval = int ( round ( plot_interval ) ) # plotting for i in self . _data_extracted . keys ( ) : points = np . mean ( self . _data_extracted [ i ] , axis = 0 ) ori_ponits_len = len ( points ) if std_area : std_points = np . std ( self . _data_extracted [ i ] , axis = 0 ) if plot_interval != 1 : points = np . asarray ( [ points [ point_ind ] for point_ind in range ( ori_ponits_len ) if point_ind % plot_interval == 0 ] ) if std_area : std_points = np . asarray ( [ std_points [ point_ind ] for point_ind in range ( len ( std_points ) ) if point_ind % plot_interval == 0 ] ) if x_shift is None : if not self . _is_all_stateio or self . _data_summary [ i ] . ip is None : x_shift = 1 else : x_shift = 0 if start_point is not None : x_shift = 0 plt . plot ( np . arange ( ori_ponits_len + 1 , step = plot_interval ) + x_shift , [ start_point ] + list ( points ) , label = i ) if std_area : plt . fill_between ( np . arange ( ori_ponits_len , step = plot_interval ) + x_shift + 1 , points - std_points , points + std_points , interpolate = True , alpha = std_alpha ) else : plt . plot ( np . arange ( ori_ponits_len , step = plot_interval ) + x_shift , points , label = i ) if std_area : plt . fill_between ( np . arange ( ori_ponits_len , step = plot_interval ) + x_shift , points - std_points , points + std_points , interpolate = True , alpha = std_alpha ) # axis & title plt . legend ( fancybox = True , framealpha = 0.5 ) plt . xlabel ( "Number of queries" ) plt . ylabel ( "Performance" ) if title is not None : plt . title ( str ( title ) ) # saving if saving_path is not None : saving_path = os . path . abspath ( saving_path ) if os . path . isdir ( saving_path ) : try : plt . savefig ( os . path . join ( saving_path , 'alipy_plotting.jpg' ) ) except : plt . savefig ( os . path . join ( saving_path , 'alipy_plotting.pdf' ) ) else : plt . savefig ( saving_path ) if show : try : # show before draw will raise an error in some versions of matplotlib plt . show ( ) except : plt . draw ( ) plt . show ( ) else : return plt