AI Outlier Detector

Find statistical outliers using IQR (Tukey fences) and Z-score methods.

Outlier Detector AI

Hi! I'm your Outlier Detector analysis assistant.

Analyze your outlier results — I'll explain flagged data points and methods used • Generate data with outliers — e.g. "generate 20 house prices with 3 extreme outliers"Explain — ask me "IQR vs Z-score — which method is better?" or "what counts as an outlier?"

Try: "Why were these points flagged?" or "Generate 25 values with 2 obvious outliers"

How to Use This AI Outlier Detector

  1. Enter your data. Paste numeric values into the input field. Both IQR and Z-score methods will be applied simultaneously.
  2. Generate results. Click Generate to run both detection methods and flag potential outliers.
  3. Review flagged points. Each flagged value shows its actual value, IQR fence status, and Z-score. Compare the two methods to assess agreement.
  4. Adjust sensitivity. Switch between 1.5×, 2×, or 3× IQR multipliers. Tighter thresholds catch more points; looser thresholds are more conservative.
  5. Chat with AI about next steps. Ask the assistant whether to keep, remove, or winsorize each outlier based on statistical principles.

What is Outlier Detection?

Outlier detection is the process of identifying data points that deviate significantly from the rest of the observations in a dataset. These unusual values can represent measurement errors, data entry mistakes, genuine extreme values, or the most interesting cases in your dataset.

This tool implements the two most widely used methods: the IQR method (Tukey fences) and the Z-score method. By running both methods simultaneously and comparing results, you get a more reliable picture of which points truly warrant investigation.

Methods Used

  • IQR Method (Tukey Fences): Values outside [Q1 − 1.5×IQR, Q3 + 1.5×IQR] are flagged. Robust to non-normal distributions, this is the standard method taught in introductory statistics.
  • Z-Score Method: Values with |z| > 3 are considered outliers (more than 3 standard deviations from the mean). Best suited for approximately normally distributed data.

What to Do with Outliers

  1. Investigate. Check if the outlier is a data entry error or measurement artifact. Fix or remove if it is clearly erroneous.
  2. Keep. If the outlier represents a genuine, valid observation, consider keeping it — especially if later analysis will use robust methods.
  3. Winsorize. Replace the extreme value with the nearest non-outlier value. This retains the observation without letting it dominate statistics like the mean.
  4. Transform. Apply log, square root, or Box-Cox transformation to reduce the influence of extreme values across the dataset.

Frequently Asked Questions

Which outlier detection method should I use?
For most cases, the IQR method (Tukey fences) is recommended — it's robust to non-normal distributions and widely accepted. Use the Z-score method if your data is approximately normally distributed. The tool runs both methods and shows results side by side for comparison.
What should I do with detected outliers?
Don't automatically delete outliers. First investigate whether they represent data entry errors (fix/remove) or genuine extreme values (consider keeping, winsorizing, or analyzing separately). The AI assistant can help you assess each flagged point.
Can I adjust the outlier detection sensitivity?
Yes. The default IQR multiplier is 1.5× (standard Tukey fences). You can switch to 2× (more conservative, fewer outliers flagged) or 3× (very conservative). The Z-score threshold can be adjusted similarly.

Key Terms

IQR Method
Data points outside [Q1−1.5×IQR, Q3+1.5×IQR] are flagged as outliers.
Z-Score Method
Values with |z| > 3 are considered statistical outliers.
Tukey Fences
The boundary defined by Q1−1.5×IQR and Q3+1.5×IQR.

Computation Method

  • Quartiles are calculated using linear interpolation (method 7 from Hyndman & Fan, 1996), consistent with Python's NumPy and pandas defaults.
  • Outlier detection uses the Tukey fences method: lower fence = Q1 − 1.5 × IQR, upper fence = Q3 + 1.5 × IQR.
  • Chart scaling caps the display axis at the upper fence value so the visualization remains clear even when extreme outliers are present.

References

  • Hyndman, R. J. & Fan, Y. (1996). “Sample Quantiles in Statistical Packages.” The American Statistician, 50(4), 361–365.
  • Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley.