Version: 3.x
rasa.utils.plotting
plot_confusion_matrix
@_needs_matplotlib_backend
def plot_confusion_matrix(confusion_matrix: np.ndarray,
classes: Union[np.ndarray, List[Text]],
normalize: bool = False,
title: Text = "Confusion matrix",
color_map: Any = None,
zmin: int = 1,
output_file: Optional[Text] = None) -> None
Print and plot the provided confusion matrix.
Normalization can be applied by setting normalize=True
.
Arguments:
confusion_matrix
- confusion matrix to plotclasses
- class labelsnormalize
- If set to true, normalization will be applied.title
- title of the plotcolor_map
- color mapping zmin:output_file
- output file to save plot to
plot_paired_histogram
@_needs_matplotlib_backend
def plot_paired_histogram(histogram_data: List[List[float]],
title: Text,
output_file: Optional[Text] = None,
num_bins: int = 25,
colors: Tuple[Text, Text] = ("#009292", "#920000"),
axes_label: Tuple[Text, Text] = ("Correct", "Wrong"),
frame_label: Tuple[Text,
Text] = ("Number of Samples",
"Confidence"),
density: bool = False,
x_pad_fraction: float = 0.05,
y_pad_fraction: float = 0.10) -> None
Plots a side-by-side comparative histogram of the confidence distribution.
Arguments:
histogram_data
- Two data vectorstitle
- Title to be displayed above the plotoutput_file
- File to save the plot tonum_bins
- Number of bins to be used for the histogramcolors
- Left and right bar colors as hex color stringsaxes_label
- Labels shown above the left and right histogram, respectivelyframe_label
- Labels shown below and on the left of the histogram, respectivelydensity
- If true, generate a probability density histogramx_pad_fraction
- Percentage of extra space in the horizontal directiony_pad_fraction
- Percentage of extra space in the vertical direction
plot_curve
@_needs_matplotlib_backend
def plot_curve(output_directory: Text, number_of_examples: List[int],
x_label_text: Text, y_label_text: Text,
graph_path: Text) -> None
Plot the results from a model comparison.
Arguments:
output_directory
- Output directory to save resulting plots tonumber_of_examples
- Number of examples per runx_label_text
- text for the x axisy_label_text
- text for the y axisgraph_path
- output path of the plot