AI Glossary / Data science and analytics / Beginner
Outlier
Definition
An outlier is an observation that is unusually different from the other observations or from the pattern expected under a specified model. It may reflect an error, a rare but genuine event, a different population or an unsuitable assumption about the data.
What it means
An unusually large transaction, a very long delivery time or an unexpected combination of measurements can all be outliers in the right context. The label is relative: a value unusual for one customer, machine or season may be ordinary for another.
Being an outlier does not automatically mean being wrong. A decimal-point mistake and a legitimate major purchase can both look extreme, but they require different responses. Outliers may be the very events an organization needs to understand.
The distinction also matters in AI. Removing every unusual training record can erase valuable rare cases. Conversely, leaving confirmed corrupt records untreated can distort a model. Detection is a prompt for investigation and an explicit handling decision, rather than a universal instruction to delete.
How it works
Analysts can inspect plots, compare values with robust summaries or use statistical and machine-learning methods. A box-plot rule, for example, flags observations beyond bounds based on the interquartile range. This is a screening convention, not a proof that the observations are invalid.
Other methods consider several features together. A combination of order size and delivery distance might be unusual even when neither feature is extreme by itself. Time-based comparisons may need to account for seasonality, operating mode and changes in the process.
Formal tests have assumptions about distributions and the number of suspected outliers. If those assumptions do not fit, the result may mislead. Several unusual points can also affect the reference against which they are judged.
After flagging an observation, trace it to its source, check units and definitions, and decide whether to correct it, retain it, analyze it separately or use a method less sensitive to extremes.
Three practical examples
- A data-quality analyst finds a recorded parcel weight of 2,000 kilograms and checks whether the source actually used grams.
- A customer-service team investigates unusually long resolution times to distinguish complex cases from a stalled workflow.
- A machine-monitoring system flags an unusual combination of vibration and temperature for inspection, without treating the flag as a confirmed equipment fault.
Think of it this way
Think of a note that sounds unexpected in a musical performance. It might be a mistake, an intentional variation or a sign that you misunderstood the piece.
The analogy is limited because statistical detection uses defined measurements and rules, rather than musical judgment. The useful connection is that unusualness invites interpretation; it does not supply the explanation by itself.
Worked example
Consider fictional delivery times of 9, 10, 10, 11, 12, 12, 13, 13 and 60 minutes. Their sum is 150, so the mean is about 16.67 minutes. The median is the fifth value, 12 minutes.
Using the convention that excludes the overall median when splitting this odd-sized sample, the lower quartile is 10 and the upper quartile is 13. The interquartile range is 3. The upper 1.5-IQR fence is 13 + 1.5 × 3 = 17.5, so 60 is flagged.
That calculation does not establish why the delivery took 60 minutes. If a timestamp was entered incorrectly, correction may be appropriate. If the delay genuinely occurred, removing it would hide part of the service experience. Reporting the median alongside the long-delay case can be more informative than silently discarding it.
Other quartile conventions can yield different numerical bounds, so the convention should be stated when reproducing a calculation.
Illustrative case study
Illustrative fictional case: Alder Repairs trains a model to estimate job duration. The team initially removes the longest jobs because they make average error look worse. A review shows that many involve a legitimate second visit for a replacement part.
The analysts restore those records, distinguish confirmed recording errors from genuine long jobs and add information about the repair process where it is available at prediction time. They evaluate ordinary and long jobs separately.
The fictional lesson is that an inconvenient observation may reveal missing context. The case does not claim that every extreme should remain unchanged or that one additional feature guarantees a better model. The handling decision depends on the intended population and the evidence about each record.
Common misconceptions and mistakes
Do not equate rare with erroneous, suspicious with fraudulent or statistically unusual with practically important. Do not remove values solely because their removal improves a preferred result.
Avoid applying a rule designed for one distribution to every dataset. Check for unit changes, duplicate records and mixtures of different populations. Also distinguish an outlying response from an influential regression observation: influence depends on how much an observation changes the fitted result, not simply on one extreme value.
Business use
Create a documented process that separates detection, investigation and treatment. Retain the original value and the reason for any correction or exclusion so that decisions remain reviewable.
Assess how important conclusions change under reasonable handling choices. For operational alerts, measure false alarms as well as missed unusual events and assign responsibility for review. An AI assistant should report the detection rule and available evidence rather than inventing a confident explanation for why a flagged event occurred.
People also ask
Should all outliers be deleted?
No. Investigate their origin and relevance. Genuine unusual events may be essential to the question.
Can an observation be an outlier only when several variables are considered?
Yes. An unusual combination can stand out even if each individual value looks ordinary.
Is an outlier always a very large value?
No. It can be unusually small, inconsistent with a relationship or unusual for a particular context.
Check your understanding
A genuine 60-minute delivery is flagged by an IQR rule. Does the flag justify replacing it with the median delivery time?
Answer: No. The flag identifies unusualness under the rule. Replacing a genuine observation needs a separate, justified analytical purpose and must not conceal the actual service outcome.
Related terms
- Anomaly detection
- Robust statistics
- Box plot
- Median
- Data Quality
- Novelty detection
- interquartile range
- influential observation
Learn next
Read interquartile range and robust statistics. Plot a small dataset and inspect its most unusual observations. For each one, separate what the detection rule says from what the source evidence establishes, then document an appropriate handling decision.
More in Data science and analytics
- Operational reporting - Operational reporting presents information about day-to-day activities so that people can monitor work, identify exceptions and decide what needs attention.
- Optimal matching - Optimal matching, in sequence analysis, measures how different two ordered sequences are by finding the least costly set of insertions, deletions and...
- Ordinal variable - An ordinal variable is a categorical variable whose categories have a meaningful order.
- p-hacking - P-hacking is the practice of selecting or changing data analyses in response to their results so that a desired finding appears statistically significant...
- Percentile Bootstrap Confidence Interval - A percentile bootstrap confidence interval estimates uncertainty by repeatedly resampling the observed data, recalculating a statistic and taking specified...
- Persistence barcode - A persistence barcode is a collection of intervals that records when topological features appear and disappear as a parameter changes.
Sources
Australian Bureau of Statistics, outlier definition: https://www.abs.gov.au/statistics/understanding-statistics/statistical-terms-and-concepts/statistical-terms-and-concepts-glossary
NIST, investigating and detecting outliers: https://itl.nist.gov/div898/handbook/eda/section3/eda35h.htm
NIST, box-plot fences and outlier concepts: https://www.itl.nist.gov/div898/handbook/prc/section1/prc16.htm
Scikit-learn, novelty and outlier detection: https://scikit-learn.org/1.5/modules/outlier_detection.html
The delivery data and repairs case are invented examples.
Previous: Outer Join Next: Outlier detection