cinnamon.plot.drift.plot_drift.plot_prediction_drift

cinnamon.plot.drift.plot_drift.plot_prediction_drift(drift_explainer: ModelDriftExplainer, prediction_type='raw', bins=10, figsize: Tuple[int, int] = (7, 5), legend_labels: Tuple[str, str] = ('Dataset 1', 'Dataset 2')) None

Plot histogram of distribution of predictions for dataset 1 and dataset 2 in order to visualize a potential drift of the predicted values. See the documentation in README for explanations about how it is computed, especially the slide presentation.

Parameters

drift_explainer: ModelDriftExplainer

A ModelDriftExplainer object.

prediction_type: str, optional (default=”raw”)

Type of predictions to consider. Choose among: - “raw”: logit predictions (binary classification), log-softmax predictions (multiclass classification), regular predictions (regression) - “proba”: predicted probabilities (only for classification models) - “class”: predicted classes (only for classification model)

binsint or sequence of scalars or str, optional (default=10)

For regression only. ‘two_heads’ corresponds to a number of bins which is the minimum of of the optimal number of bins for dataset 1 and dataset 2 taken separately. Other value of “bins” parameter passed to matplotlib.pyplot.hist function are also accepted.

figsizeTuple[int, int], optional (default=(7, 5))

Graphic size passed to matplotlib

legend_labelsTuple[str, str] (default=(‘Dataset 1’, ‘Dataset 2’))

Legend labels used for dataset 1 and dataset 2

Returns

None