Ejemplo n.º 1
0
    def plot_history(self, ax=None, yscale=None):
        """Plot the gain/loss of every point in the order in which they were sampled."""
        if not self._examples:
            raise ValueError("no existing data available to be plotted")

        iterations = range(1, len(self._examples) + 1)
        metrics = ((list)(map(_coconut.operator.itemgetter(self._metric), (sorted_examples)(self._examples))))

        return plot(iterations, metrics, ax=ax, yscale=yscale, title="History plot for {_coconut_format_0}".format(_coconut_format_0=(self._file_name)), xlabel="Number of trials $n$", ylabel="The {_coconut_format_0} on the $n$th trial".format(_coconut_format_0=(self._metric)))
Ejemplo n.º 2
0
    def plot_convergence(self, ax=None, yscale=None):
        """Plot the best gain/loss over the history of optimization.
        Based on skopt.plots.plot_convergence."""
        if not self._examples:
            raise ValueError("no existing data available to be plotted")

        iterations = range(1, len(self._examples) + 1)
        best_metrics = ((list)(map(_coconut.operator.itemgetter(self._metric), (running_best)((sorted_examples)(self._examples)))))

        return plot(iterations, best_metrics, ax=ax, yscale=yscale, title="Convergence plot for {_coconut_format_0}".format(_coconut_format_0=(self._file_name)), xlabel="Number of trials $n$", ylabel="Best {_coconut_format_0} after $n$ trials".format(_coconut_format_0=(self._metric)))
Ejemplo n.º 3
0
 def plot_partial_dependence_1D(self,
                                i_name,
                                ax=None,
                                yscale=None,
                                **kwargs):
     """Constructs a 1D partial dependence plot using self.partial_dependence."""
     xi, yi = self.partial_dependence(i_name, **kwargs)
     return plot(xi,
                 yi,
                 ax=ax,
                 yscale=yscale,
                 title="Partial dependence of {_coconut_format_0}".format(
                     _coconut_format_0=(i_name)),
                 xlabel="Values of {_coconut_format_0}".format(
                     _coconut_format_0=(i_name)),
                 ylabel="The loss at each point".format())