visualization¶
- plot_classification_timeline(predictions, categories, *, annotations=None, timestamps=None, y_proba=None, y_proba_smoothed=None, axes=None, figsize=(10, 3), dpi=100, category_labels=None, interval=None, limit_interval=True, x_tick_step=None, x_tick_conversion=None, x_label=None)¶
Plot a timeline of predictions and annotations.
- Parameters:
predictions (
DataFrame) – Prediction data to visualize.annotations (
DataFrame|None, default:None) – Annotation data to visualize.timestamps (
ndarray|None, default:None) – Corresponding timestamps fory_probaandy_proba_smoothed.y_proba (
ndarray|None, default:None) – Predicted probabilities.y_proba_smoothed (
ndarray|None, default:None) – Smoothed predicted probabilities.axes (
_Array[Axes] |None, default:None) – Matplotlib Axes objects to plot on, should be of lengthlen(categories).figsize (
tuple[float,float], default:(10, 3)) – Figure size in inches.dpi (
float, default:100) – Dots per inch.category_labels (
Iterable[str] |None, default:None) – Category labels to use for the timeline.interval (
tuple[float,float] |None, default:None) – Start and end times for the timeline.limit_interval (
bool, default:True) – Whether to limit the interval to the data range.x_tick_step (
float|None, default:None) – Step size for x-axis ticks.x_tick_conversion (
Callable[[Sequence[float]],Sequence[str]] |None, default:None) – Function to convert x-axis ticks.
- plot_confusion_matrix(y_true, y_pred, *, ax=None, figsize=(3, 3), dpi=100, category_labels=None, show_colorbar=True)¶
Plot a confusion matrix of one or more sets of predictions.
- Parameters:
y_true (
ndarray|Iterable[ndarray]) – Ground truth (correct) target values.y_pred (
ndarray|Iterable[ndarray]) – Estimated targets as returned by a classifier.ax (
Axes|None, default:None) – Matplotlib Axes object to plot on. If None, a new figure and axes will be created.figsize (
tuple[float,float], default:(3, 3)) – Figure size in inches.dpi (
float, default:100) – Dots per inch.category_labels (
Sequence[str] |None, default:None) – List of category labels to use for the confusion matrix.show_colorbar (
bool, default:True) – Whether to show the colorbar.