Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions alibi_detect/utils/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pandas as pd
from sklearn.metrics import roc_curve, auc
from typing import Dict, Union
import warnings


def plot_instance_score(preds: Dict,
Expand Down Expand Up @@ -77,6 +78,11 @@ def plot_feature_outlier_image(od_preds: Dict,
instance_ids = list(range(len(od_preds['data']['is_outlier'])))
n_instances = min(max_instances, len(instance_ids))
instance_ids = instance_ids[:n_instances]

if outliers_only and n_instances == 0:
warnings.warn('No outliers found!', UserWarning)
return

n_cols = 2

if n_channels == 3:
Expand Down