credible.plot¶
Plotting support for our curves.
Functions
|
Plot the ROC curve with confidence interval bounds. |
|
Generate a somewhat fancy canvas to draw ROC/DET-style curves. |
|
Generate a somewhat fancy canvas to draw Precision-Recall-style curves. |
- credible.plot.tight_layout(axis_labels, title=None)[source]¶
Generate a somewhat fancy canvas to draw ROC/DET-style curves.
Works like a context manager, yielding a figure and an axes set in which the ROC curves should be added to. Once the context is finished,
matplotlib.pyplot.tight_layout()is called.- Parameters:
- Yields:
A 2-tuple containing the following entries
* figure (The figure that should be finally returned to the user)
* axes (An axis set where to precision-recall plots should be added to)
- Return type:
- credible.plot.tight_layout_f1iso(axis_labels, title=None)[source]¶
Generate a somewhat fancy canvas to draw Precision-Recall-style curves.
Works like a context manager, yielding a figure and an axes set in which the PR curves should be added to. Once the context is finished,
matplotlib.pyplot.tight_layout()is called.The generated figure canvas contains F1-iso lines on the background.
- Parameters:
- Yields:
A 2-tuple containing the following entries
* figure (The figure that should be finally returned to the user)
* axes (An axis set where to precision-recall plots should be added to)
- Return type:
- credible.plot.curve_ci(curve, lower, upper, alpha_multiplier=0.3, **kwargs)[source]¶
Plot the ROC curve with confidence interval bounds.
This method will call
matplotlibto plot the ROC curve for a system which contains a particular set of negatives and positives scores, including its credible/confidence interval bounds. We use the standardmatplotlib.pyplot.plot()command. All parameters passed with exception of the three first parameters of this method will be directly passed to the plot command.Note
This function does not initiate and save the figure instance, it only issues the plotting command. You are the responsible for setting up and saving the figure as you see fit.
- Parameters:
curve (
tuple[Union[Sequence[float],ndarray[tuple[int,...],dtype[float64]]],Union[Sequence[float],ndarray[tuple[int,...],dtype[float64]]]]) – Tuple with two floating point array-like structures that define the first (x; horizontal) and second (y; vertical) coordinates to be plotted.lower (
tuple[Union[Sequence[float],ndarray[tuple[int,...],dtype[float64]]],Union[Sequence[float],ndarray[tuple[int,...],dtype[float64]]]]) – Tuple with two floating point array-like structures that define the first (x; horizontal) and second (y; vertical) coordinates of the lower bounding confidence curve (after hull expansion) ofcurve.upper (
tuple[Union[Sequence[float],ndarray[tuple[int,...],dtype[float64]]],Union[Sequence[float],ndarray[tuple[int,...],dtype[float64]]]]) – Tuple with two floating point array-like structures that define the first (x; horizontal) and second (y; vertical) coordinates of the upper bounding confidence curve (after hull expansion) ofcurve.alpha_multiplier (
float) – A value between 0.0 and 1.0 to express the amount of transparence to be applied to the confidence/credible margins. This will be used to multiply thealphachannel of the line itself. If the default is unchanged, then this is the value of the alpha channel on the margins.**kwargs – Extra plotting parameters, which are passed directly to
matplotlib.pyplot.plot().
- Return type:
- Returns:
A 2-tuple with the line and fill objects drawing the curve.