Skip to content

Commit

Permalink
Add warning to plot_feature_outier_image
Browse files Browse the repository at this point in the history
  • Loading branch information
mauicv committed Apr 24, 2023
1 parent 9d10d24 commit 6408792
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 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 @@ -79,6 +80,7 @@ def plot_feature_outlier_image(od_preds: Dict,
instance_ids = instance_ids[:n_instances]

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

n_cols = 2
Expand Down

0 comments on commit 6408792

Please sign in to comment.