Skip to content
Merged
Changes from 4 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, stacklevel=3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mauicv is the warning swallowed without stacklevel=3?

Copy link
Contributor

@mauicv mauicv Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've removed it!

return

n_cols = 2

if n_channels == 3:
Expand Down