77 Outlier Detection Interview Questions and Answers (2026)

Outlier detection isn't a niche skill anymore—it's baked into fraud systems, monitoring, data quality pipelines, and anything that has to spot the weird before it breaks. As data scales, interviewers expect you to explain not just what an outlier is, but which method fits which data and why. Walk in shaky on the tradeoffs and you'll get exposed fast.
This guide gives you 77 questions with tight, interview-ready answers—code where it actually helps—organized Junior to Mid to Senior. Start with definitions and taxonomy, then work up through statistical tests, distance/density methods, robust statistics, and method selection. By the end, you'll reason through problems instead of reciting buzzwords.
Q1.Explain the concept of outliers and their impact on a dataset.
An outlier is an observation that deviates markedly from the rest of the data: it lies far from the bulk of the distribution and can distort analyses that assume most points are typical.
What an outlier is: A point inconsistent with the pattern of the majority: extreme in one feature (univariate) or in the joint feature space (multivariate).
Impact on statistics: Non-robust measures like the mean, variance, and Pearson correlation shift heavily; the median and IQR resist this.
Impact on models: Least-squares regression chases outliers (squared error), clustering centroids drift, and distance-based methods get skewed.
Not always bad: Sometimes the outlier is the signal (fraud, fault, disease), so blind removal can discard the most valuable information.
Q2.What is outlier detection and why is it important in data analysis or machine learning?
Outlier detection is the process of identifying observations that do not conform to expected patterns; it matters because those points either corrupt models or represent the rare events we actually care about.
Two motivations:
Data cleaning: find and handle errors before they bias estimators and models.
Discovery: the anomaly itself is the target (fraud, intrusion, equipment failure).
Why it matters in ML:
Improves model accuracy and robustness by preventing a few points from dominating training.
Enables high-value applications where positives are rare and costly to miss.
Typical domains: Finance (fraud), cybersecurity (intrusion), healthcare (rare diagnoses), manufacturing (defects), monitoring (system faults).
Q3.What are outliers in a dataset, and how do they differ from noise or anomalies?
An outlier is any point far from the majority of the data; anomalies and noise are two categories of outliers distinguished by whether the deviation is meaningful (anomaly) or just random error (noise).
Outlier: The broad term: an observation inconsistent with the rest, regardless of cause.
Anomaly: An outlier generated by a genuinely different process, carrying actionable meaning (fraud, attack, malfunction).
Noise: An outlier caused by random error or measurement variability: no useful information, usually removed.
Practical framing: The same numeric deviation can be noise or anomaly depending on context; distinguishing them is the hard part.
Q4.Why do outliers appear in data, and what are the common sources of outliers?
Outliers arise whenever a data point comes from a different generating process than the majority, whether through genuine rare behavior or through errors introduced during data collection and handling.
Data errors: Measurement or sensor faults, entry/typing mistakes, unit or encoding mismatches.
Processing issues: Faulty preprocessing, bad joins/merges, or sampling from the wrong population.
Genuine rare events: Real but infrequent behavior: fraud, fault, natural extremes: these are the interesting anomalies.
Natural variability: Heavy-tailed distributions produce legitimate extreme values that are not errors.
Q5.What is anomaly detection?
Anomaly detection is the task of identifying data points, patterns, or events that deviate significantly from a defined notion of normal behavior.
Core idea: Model what normal looks like, then flag observations that fall outside it.
Common types:
Point anomaly: a single instance far from the rest.
Contextual anomaly: normal in general but abnormal in its context (e.g. high heating in summer).
Collective anomaly: a group of points abnormal together though individually normal.
Learning setups: Supervised (labeled anomalies), semi-supervised (normal-only training), and unsupervised (no labels, most common).
Q6.What are sentinel or placeholder values like 999 or -1, and why do they show up as outliers?
999 or -1, and why do they show up as outliers?Sentinel (placeholder) values are special numbers used to encode "missing", "not applicable", or "unknown" inside a numeric field, such as 999, -1, or 9999. They show up as outliers because a detector treats them as real measurements even though they are actually flags for absent data.
What they are:
Out-of-range codes chosen to be "impossible" real values (age = 999, temperature = -999, income = -1).
Legacy conventions from systems that had no dedicated null type.
Why they read as outliers:
They sit far from the real data mass, so distance, z-score, or IQR methods flag them.
They distort means, variances, and correlations if treated as genuine numbers.
How to handle them:
Look for suspicious spikes at round numbers in a histogram or value-count.
Convert known sentinels to proper missing values (NaN / NULL) before outlier analysis.
Confirm the codebook: the same field may use different sentinels across sources.
Q7.What is a distance-based outlier?
A distance-based outlier is a point that is far from most other points in feature space: it lacks enough close neighbors, so it is judged anomalous by how isolated it is rather than by fitting a probability model.
Core idea:
A classic definition (Knorr & Ng): a point is an outlier if fewer than a fraction of points lie within distance d of it.
Variants use the distance to the k-th nearest neighbor as an outlier score.
Practical notes:
Requires a meaningful distance metric, so scaling and normalization matter.
Struggles with varying density (a global distance cutoff misjudges dense vs. sparse regions), which motivates density-based methods like LOF.
Suffers in high dimensions where distances concentrate (curse of dimensionality).
Q8.How do you detect outliers in a dataset?
There is no single method: you choose based on dimensionality, whether the data is labeled, and the distribution's shape, usually combining a visual pass with statistical or model-based detectors and always validating flags against domain knowledge.
Visual / exploratory: Boxplots, histograms, and scatterplots for a first look; good for spotting sentinels and obvious extremes.
Statistical (univariate):
z-score or modified z-score (robust, uses median/MAD) for roughly normal data.
IQR rule: flag points below Q1 - 1.5·IQR or above Q3 + 1.5·IQR, distribution-free.
Multivariate / distance / density:
Mahalanobis distance captures correlation structure.
kNN distance and Local Outlier Factor (LOF) handle local density.
Model-based / machine learning: Isolation Forest, One-Class SVM, and autoencoders for high-dimensional or complex data.
Practical steps:
Clean known sentinels and handle missing values first.
Scale features so distance-based methods are fair.
Detect within relevant segments when normal is context-dependent.
Investigate flags before deciding to keep, transform, or remove them.
Q9.How do you detect outliers using box plots, z-scores, or interquartile range (IQR)?
All three are univariate statistical methods that define a "normal" range and flag points outside it; they differ in how they build that range and what they assume about the data.
Box plot / IQR (same underlying rule):
Compute Q1, Q3, IQR; flag points outside Q1 - 1.5*IQR and Q3 + 1.5*IQR.
Robust and distribution-free; the box plot is just the visual form of this rule.
Z-score:
Compute z = (x - mean)/std; flag |z| > 3.
Best for roughly normal data; sensitive to the outliers it seeks (use modified Z-score for robustness).
Practical guidance:
Skewed / unknown distribution: prefer IQR.
Approximately normal: Z-score gives a probabilistic threshold.
Always inspect visually first (box plot / histogram) before trusting any threshold.
Q10.What is a boxplot and how does it detect outliers?
A box plot is a graphical summary of a distribution's five-number summary (min, Q1, median, Q3, max) that visualizes spread and skew, and it flags outliers as points lying beyond the whiskers.
Components:
The box spans Q1 to Q3 (the IQR), with a line at the median.
Whiskers extend to the most extreme points still within Q1 - 1.5*IQR and Q3 + 1.5*IQR.
Outlier detection: Any point beyond the whiskers is drawn individually and treated as an outlier: it is exactly the Tukey/IQR rule made visual.
Strengths and limits:
Robust and quick, and shows skew at a glance.
Univariate only: cannot catch outliers that arise from combinations of features.
Q11.What is the 68-95-99.7 rule, and how is it applied in outlier detection for normally distributed data?
The 68-95-99.7 rule (the empirical rule) states that for a normal distribution about 68%, 95%, and 99.7% of values fall within 1, 2, and 3 standard deviations of the mean; in outlier detection this makes points beyond ±3 std devs statistically rare and thus candidate outliers.
The bands:
±1σ ≈ 68%, ±2σ ≈ 95%, ±3σ ≈ 99.7% of the data.
Beyond ±3σ lies only ~0.3% of values, so those are treated as outliers.
Application:
It is the justification for the |z| > 3 threshold in the Z-score method.
Choosing ±2σ flags ~5% (more sensitive); ±3σ is stricter.
Caveat: Only valid when data is approximately normal; on skewed or heavy-tailed data these percentages break down and the rule over- or under-flags.
Q12.What are some common statistical methods for outlier detection?
Common statistical methods define expected behavior from summary statistics or a fitted distribution and flag points that deviate too far; they range from simple univariate rules to multivariate and probabilistic tests.
Univariate threshold methods:
Z-score: |z| > 3 under normality.
Modified Z-score (median/MAD): robust alternative.
IQR / Tukey fences and box plots: distribution-free.
Multivariate / distance-based: Mahalanobis distance: accounts for covariance among features.
Formal hypothesis tests: Grubbs' test (one outlier at a time), Dixon's Q test (small samples), and generalized ESD.
Choosing: Prefer robust methods (MAD, IQR) when outliers are present; use distributional tests when assumptions genuinely hold.
Q13.What are quartiles and the Interquartile Range (IQR)?
Quartiles are the three cut points that divide sorted data into four equal parts, and the Interquartile Range (IQR) is the spread of the middle 50% of the data, defined as Q3 minus Q1.
The quartiles:
Q1 (25th percentile): 25% of data lies below it.
Q2 (50th percentile): the median.
Q3 (75th percentile): 75% of data lies below it.
IQR:
IQR = Q3 - Q1, the range covering the central 50% of observations.
A robust measure of spread: unlike variance, it ignores the extreme tails.
Why it matters: It underlies box plots and Tukey fences, giving a distribution-free basis for outlier detection.
Q14.Why must you scale features before applying any distance-based outlier method?
Distance-based methods treat every feature equally in the distance formula, so a feature with a larger numeric range dominates the distance and silently defines what counts as an outlier; scaling puts all features on comparable footing.
Distance is scale-sensitive: In Euclidean distance, a feature measured in thousands swamps one measured in fractions, so the small-range feature is effectively ignored.
Affected methods: k-NN, LOF, One-Class SVM (RBF), k-means distances: all rely on raw distances.
How to scale:
Use StandardScaler (z-score) or RobustScaler; the latter uses median/IQR so the scaling itself isn't skewed by the outliers.
Fit the scaler on training data only to avoid leakage.
Exceptions: Mahalanobis distance already accounts for covariance/scale, and tree-based methods like Isolation Forest are scale-invariant.
Q15.How does anomaly detection differ from noise removal?
Both deal with points that deviate from the norm, but anomaly detection aims to find and study meaningful deviations, while noise removal aims to discard uninteresting random errors so the underlying signal is cleaner.
Goal:
Anomaly detection: surface the deviation as the result of interest.
Noise removal: suppress deviation as a nuisance to improve downstream analysis.
Semantic value: An anomaly carries meaning (fraud, fault); noise is meaningless random perturbation.
Relationship: Noise is a barrier to anomaly detection: it sits between normal data and true anomalies and must be filtered out to avoid false alarms.
Q16.What is the definition of an outlier and why is there no single formal definition?
An outlier is commonly defined (Hawkins) as an observation that deviates so much from other observations as to arouse suspicion it was generated by a different mechanism; there is no single formal definition because "normal" depends entirely on the data and application.
Why definitions vary: "Far enough to be different" requires choosing a distance, a threshold, and a model of normality, all context-dependent.
Method-relative: Statistical methods call it low-probability; distance methods call it far; density methods call it isolated: each implies a different boundary.
Domain dependence: The same deviation is acceptable variation in one domain and a critical anomaly in another.
Consequence: Outlierness is a matter of degree, so most methods output a score and a chosen cutoff rather than a hard yes/no.
Q17.What is the role of statistics in anomaly detection?
Statistics provides the foundational framework for anomaly detection: it models the distribution of normal data so that low-probability observations can be flagged as anomalies in a principled, quantifiable way.
Modeling normality: Fit a distribution (e.g. Gaussian) and treat points in the low-probability tails as outliers.
Classic tools:
Z-score for how many standard deviations a point lies from the mean.
IQR / boxplot rule using quartiles, robust to extreme values.
Hypothesis tests like Grubbs' for formally testing a suspected outlier.
Multivariate extension: Mahalanobis distance accounts for feature correlations and scale.
Value and limits: Interpretable and grounded in probability, but assumes a distribution and struggles in high dimensions, where ML methods take over.
Q18.Can an outlier be the most interesting signal in the data rather than an error, and how do you decide whether a flagged point is a mistake, a rare-but-real event, or the thing you actually care about?
Yes: in many domains the outlier is the whole point (fraud, disease, a novel physical event), so an outlier is not automatically an error. Deciding what a flagged point means requires context and provenance, not just the detector's score.
Outliers can be the target, not noise: Fraud, intrusions, equipment failure, and rare diseases are defined by deviation: the anomaly is the signal you built the system to find.
Three interpretations to distinguish:
Mistake: data-entry error, sensor glitch, unit mismatch, corrupted join.
Rare-but-real: a genuine tail event that is valid but uninteresting for your task.
The thing you care about: a real event that is exactly what the analysis targets.
How to decide:
Trace provenance: is the value physically possible, consistent across correlated fields, and reproducible in the source system?
Check for tell-tale error patterns: sentinel values, unit switches, off-by-timezone, duplicated rows.
Use domain knowledge and a subject-matter expert to ask whether the point is plausible in context.
Never silently delete: label and document, because the decision depends on the goal (data cleaning vs. anomaly discovery).
Q19.Can you explain the three main types of outliers — point (global), contextual (conditional), and collective — and give an example of each?
Point, contextual, and collective outliers differ by what they are compared against: the whole dataset, a specific context, or a group whose collective pattern deviates.
Point (global) outlier:
A single instance far from all the rest, judged against the entire distribution.
Example: a $1,000,000 charge on an account whose transactions are usually under $100.
Contextual (conditional) outlier:
Anomalous only within a context defined by other attributes (time, location, group).
Example: 30°C is normal in summer but an outlier if recorded in winter: the value is fine, the context isn't.
Collective outlier:
A set of points that is anomalous together even though each point alone looks normal.
Example: a flat ECG segment where each reading is plausible, but the sustained pattern signals cardiac arrest.
Q20.What is the difference between a univariate and a multivariate outlier, and can a point be an outlier multivariately even if it's not univariately?
A univariate outlier is extreme on a single variable, while a multivariate outlier is unusual in the joint relationship between two or more variables. A point can absolutely be a multivariate outlier without being extreme on any single dimension.
Univariate: Detected per column with z-score, IQR, or boxplots: ignores relationships between variables.
Multivariate: Detected against the joint distribution using Mahalanobis distance, or models that capture correlation structure.
Why one without the other happens:
Example: height 150 cm and weight 120 kg may each be within normal range, but their combination violates the height-weight correlation, making it a multivariate outlier.
This is why per-column screening misses points that break correlations.
Q21.Why should you detect outliers per group or segment rather than globally, and how does this relate to contextual outliers?
You detect per group when "normal" depends on the group: a value can be typical globally yet extreme within its own segment, and vice versa. This is exactly the contextual-outlier idea, where the group defines the context.
Why global detection misleads:
Mixing heterogeneous groups (different stores, sensors, age bands) inflates variance and hides local anomalies.
A high salary may be normal for executives but an outlier among interns: the global distribution blurs both.
Connection to contextual outliers: The segment (region, time window, device) is the contextual attribute; you compare each point only to peers in the same context.
How to do it:
Group by the contextual key, then apply the detector within each group (e.g., group-wise IQR or z-score).
Watch for tiny groups where per-group statistics are unstable: fall back or pool when a segment has too few points.
Q22.How does the Interquartile Range (IQR) method, also known as Tukey fences, work for outlier detection, and what are its advantages and disadvantages compared to the Z-score method?
The IQR (Tukey fences) method flags points that fall outside a range built from the quartiles: it uses the middle 50% of the data to define what is "normal" and treats the tails beyond fences as outliers.
How it works:
Compute Q1 (25th percentile), Q3 (75th percentile), and IQR = Q3 - Q1.
Fences: lower = Q1 - 1.5*IQR, upper = Q3 + 1.5*IQR; points outside are outliers (3.0 factor for "extreme").
Advantages over Z-score:
Robust: quartiles are not pulled by extreme values the way mean/std are, so it resists the masking effect.
Distribution-free: makes no normality assumption, works on skewed data.
Disadvantages:
The 1.5 factor is a convention, not derived from the data, and can be arbitrary.
Purely univariate and can over-flag on highly skewed or multimodal distributions.
Z-score contrast: Z-score is best for roughly normal data and gives a probabilistic threshold, but is sensitive to the very outliers it seeks.
Q23.Why use IQR for outlier detection rather than another method?
IQR for outlier detection rather than another method?IQR is a robust, distribution-free rule: it uses quartiles (medians of halves) that don't shift when extreme values are present, so the outliers you're hunting don't corrupt the very thresholds used to find them.
Robust to the outliers themselves: Quartiles have a high breakdown point (~25%), unlike the mean and standard deviation which a single extreme value can inflate (masking effect).
No normality assumption: Z-score assumes roughly Gaussian data; IQR works on any continuous distribution, making it a safer default for unknown data.
Simple and interpretable: Just Q1 - 1.5*IQR and Q3 + 1.5*IQR; easy to explain and visualize as boxplot whiskers.
Caveats: It is skew-sensitive (symmetric fences on asymmetric data over-flag one tail) and it's univariate, so it misses multivariate/contextual outliers.
Q24.Where does the 1.5 multiplier in Tukey's fences come from, and roughly what false-flag rate does it produce under a normal distribution?
The 1.5 is a pragmatic convention chosen by Tukey as a balance between flagging too much and too little: not derived from a formula but calibrated so that clearly typical values stay inside the fences. Under a normal distribution it flags roughly 0.7% of observations.
Where 1.5 comes from: Tukey picked it as a round "middle" value: 1.0 would be too aggressive, 3.0 (his "far out" fence) marks extreme outliers, so 1.5 is the everyday whisker.
The normal-distribution math:
For a normal, IQR ≈ 1.349σ, and Q3 ≈ +0.674σ. The upper fence sits at 0.674σ + 1.5·1.349σ ≈ 2.698σ.
P(|Z| > 2.698) ≈ 0.0035 per tail, so ≈ 0.7% total false-flag rate on genuinely normal data.
Implication: In large clean samples you'll still flag ~1 in 140 points, so "flagged" is not "invalid"; investigate rather than auto-delete.
Q25.Can you explain outlier detection methods that rely on assumptions of a normal distribution, such as the Z-score?
Z-score?Normality-based methods assume the data follows a Gaussian, then flag points that fall too many standard deviations from the mean; the Z-score is the canonical example, measuring each point's distance from the mean in SD units.
Z-score mechanics:
Z = (x - mean) / SD; common thresholds are |Z| > 3 (≈0.3% of a normal) or |Z| > 2.5.
Relies on the empirical rule: ~99.7% of normal data lies within ±3σ.
Why the normality assumption matters: On non-normal data the ±3σ probabilities are wrong, so thresholds over- or under-flag.
Key weakness: non-robust estimators: Both the mean and SD are pulled by outliers, so one extreme value can shift the threshold (masking and swamping).
Related normal-based methods: Grubbs' test and the ESD (generalized extreme Studentized deviate) test formalize this with hypothesis testing but still assume normality.
Q26.Can you discuss the impact of normality assumptions and methods for detecting normality when identifying outliers?
Normality assumptions decide whether a σ-based rule is even valid: if data isn't Gaussian, the probabilities behind thresholds like ±3σ are meaningless and you'll systematically over- or under-flag. So you should check normality (visually and with tests) before trusting any mean/SD-based detector.
Impact of the assumption:
Skew makes symmetric ±3σ fences over-flag the long tail and under-flag the short one.
Heavy tails produce many legitimate extremes that a Gaussian rule wrongly calls outliers.
Visual checks:
Q-Q plot against a normal is the most informative: tail curvature reveals skew/heavy tails.
Histogram and boxplot for a quick shape read.
Formal tests:
Shapiro-Wilk (good for small/medium n), Anderson-Darling (tail-sensitive), and D'Agostino-Pearson (uses skew and kurtosis).
Caveat: with large n these tests reject normality on trivial deviations, so pair them with plots.
Practical response: If non-normal: transform (log/Box-Cox), use robust rules (MAD, IQR), or model the actual distribution instead of forcing a Gaussian.
Q27.Why do heavy tails and skew break sigma-based outlier rules, and how does a log or Box-Cox transformation help?
Sigma-based rules assume symmetric, light-tailed data where mean and SD summarize the whole distribution; skew and heavy tails violate this by inflating the SD and displacing the mean, so the ±kσ fences land in the wrong place. A log or Box-Cox transform reshapes the data toward symmetry and lighter tails, restoring the assumptions the rule needs.
Why heavy tails break σ-rules:
Large extremes inflate the SD, widening the fences (swamping) or hiding real outliers (masking).
The ±3σ ≈ 99.7% guarantee only holds for a normal; heavy tails have far more mass beyond 3σ.
Why skew breaks them: Symmetric fences around a mean that's pulled toward the long tail over-flag one side and under-flag the other.
How log helps: It compresses large values more than small ones, pulling in a right-skewed heavy tail toward symmetry (works for positive, multiplicative data).
How Box-Cox helps: A parameterized family (x^λ - 1)/λ that estimates the λ best normalizing the data (log is the λ=0 case); more flexible than a fixed log.
Then apply the rule on the transformed scale: Run Z-score or IQR after transforming; caveats: needs positive data (shift if not), and interpret flagged points back on the original scale.
Q28.How does the Grubbs test detect an outlier, and what are its assumptions and limitations?
The Grubbs test detects a single outlier in a univariate, normally distributed dataset by measuring how many standard deviations the most extreme point lies from the sample mean, then comparing that to a critical value.
The test statistic:
G = max|x_i - mean| / s, where s is the sample standard deviation.
A large G means the extreme point is far from the mean relative to the spread.
Decision rule: Compare G to a critical value derived from the t-distribution at your chosen significance level; if G exceeds it, reject the point as an outlier.
Assumptions:
Data (minus the suspected outlier) is approximately normally distributed.
Univariate and reasonably sized sample (mean and s are unstable for very small n).
Limitations:
Detects only one outlier at a time; masking (multiple outliers inflate s and hide each other).
Sensitive to the normality assumption; skewed data produces false detections.
If you iterate it, you must adjust for multiple testing.
Q29.What is Dixon's Q test and when is it appropriate to use it?
Dixon's Q test flags a single outlier in a small dataset by comparing the gap between the suspect point and its nearest neighbor to the total range of the data.
The Q statistic:
Q = gap / range, where gap is the distance from the suspect value to the closest remaining value, and range is (max - min).
Compare Q to a tabulated critical value; if Q is larger, reject the point.
When to use it:
Small samples, typically 3 to ~30 points, where computing a reliable mean/std is hard.
Assumes approximately normal data and only one suspected outlier (test the smallest or largest, not both blindly).
Limitations:
Only one outlier per test; suffers masking with multiple outliers.
Should not be applied repeatedly without care, and it's unreliable for large datasets (use Grubbs or ESD instead).
Q30.What is Chauvenet's criterion and how does it decide whether to reject a data point?
Chauvenet's criterion rejects a data point if its expected number of occurrences (given a normal distribution and the sample size) is less than one half: essentially, if a value is so extreme that fewer than half a point would be expected that far out, it's deemed an outlier.
The procedure:
Compute the mean and standard deviation, then the z-score of the suspect point: z = |x - mean| / s.
Find the probability P of a value being at least that extreme under the normal distribution.
Multiply by n (sample size); if n * P < 0.5, reject the point.
Intuition: The threshold scales with n: larger datasets legitimately contain more extreme values, so the rejection cutoff widens.
Limitations:
Assumes normality and is somewhat arbitrary (the 0.5 cutoff has no rigorous statistical justification).
Classic advice is to apply it only once, not iteratively, and it can reject legitimate data.
Q31.How can DBSCAN be used for outlier detection, and what role do noise points play in this context?
DBSCAN be used for outlier detection, and what role do noise points play in this context?DBSCAN is a density-based clustering algorithm that groups points in dense regions and labels points that don't belong to any dense region as noise: those noise points are precisely the outliers, so outlier detection is a natural by-product of clustering.
Key parameters:
eps: the neighborhood radius.
minPts: the minimum number of points within eps to form a dense region.
Point categories:
Core point: has at least minPts neighbors within eps.
Border point: within eps of a core point but not itself dense.
Noise point: neither core nor border; these are the outliers.
Why this works for outliers:
No need to specify the number of clusters, and it finds arbitrarily shaped clusters.
Points in low-density areas fail to join any cluster and fall out as noise.
Caveats:
Very sensitive to eps and minPts; a single global eps struggles with clusters of varying density (where LOF or HDBSCAN do better).
Distance-based, so it degrades in high dimensions.
Q32.Explain how k-Nearest Neighbors (k-NN) can be adapted for anomaly detection.
k-NN) can be adapted for anomaly detection.k-NN turns distance into an anomaly score: a point far from its neighbors sits in a sparse region and is likely an outlier.
Core idea: score by distance to neighbors:
Use the distance to the k-th nearest neighbor, or the average distance to all k neighbors, as the outlier score.
Normal points live in dense areas (small distances); outliers are isolated (large distances).
Flagging outliers: Threshold the score, or take the top-N highest scores as anomalies.
Choice of k matters: Too small: sensitive to noise; too large: smooths over small clusters.
Limitations:
Uses a global distance cutoff, so it struggles with clusters of varying density (that's what LOF fixes).
Requires scaled features and is costly on large datasets (pairwise distances).
Q33.How do you interpret a LOF score, and what does a value near 1 versus well above 1 tell you?
LOF (Local Outlier Factor) compares a point's local density to that of its neighbors; the score is roughly a ratio, so ~1 means "as dense as my neighbors" (normal) and well above 1 means "much sparser than my neighbors" (a local outlier).
What the score is: The ratio of the average local density of a point's neighbors to the point's own local density.
Reading values:
≈ 1: density matches the neighborhood, an inlier.
< 1: point sits in a denser region than its neighbors (deep inlier).
≫ 1 (e.g. 1.5, 2+): markedly lower density than its neighbors, a strong outlier.
Why it's "local": It compares density relative to the local neighborhood, so it can flag a point that is sparse for its cluster even in a dataset with clusters of very different densities (where global k-NN fails).
Practical note: There is no universal threshold; interpret scores relatively and tune n_neighbors.
Q34.What is the difference between supervised, unsupervised, and semi-supervised (novelty detection) approaches to outlier detection, and when would you use each?
They differ by how much labeled information you have: supervised uses labels for both normal and anomalous classes, unsupervised uses none and assumes anomalies are rare/different, and semi-supervised (novelty detection) trains only on clean/normal data.
Supervised:
Requires labeled anomalies and normals; framed as (usually imbalanced) classification.
Use when you have reliable labels and anomalies resemble past ones; fails on novel anomaly types.
Unsupervised:
No labels; assumes outliers are few and structurally different from the bulk of data.
Use when labels are unavailable and the training data is contaminated (e.g. IsolationForest, LOF).
Semi-supervised / novelty detection:
Trains only on data known to be clean, then flags deviations at inference.
Use when you can curate a normal-only dataset and want to detect anything unlike it (e.g. OneClassSVM).
Rule of thumb: Labels for both classes: supervised; clean-only data: novelty detection; messy unlabeled data: unsupervised.
Q35.When would you use One-Class SVM for outlier detection?
One-Class SVM for outlier detection?Use One-Class SVM for novelty detection when you have a mostly clean sample of normal data and want a flexible, nonlinear boundary around it, especially with moderate-sized, well-scaled feature sets.
Good fit:
Training data is (nearly) outlier-free: it learns the support of the normal distribution.
The normal region is nonlinear: the RBF kernel captures complex shapes a simple threshold can't.
Key knobs:
nu: upper bound on the fraction of outliers/support vectors (controls tightness).
gamma: RBF kernel width; too large overfits, too small underfits.
When to avoid:
Large datasets: training scales poorly (roughly quadratic).
Heavily contaminated training data: it is sensitive to outliers in the training set (prefer IsolationForest or robust methods).
Unscaled features: distance/kernel-based, so standardize first.
Q36.What does the contamination parameter control in detectors like Isolation Forest, and what happens if you set it wrong?
contamination parameter control in detectors like Isolation Forest, and what happens if you set it wrong?contamination is the expected proportion of outliers in the data; it sets the decision threshold on the anomaly score that separates inliers from outliers, not how the scores themselves are computed.
What it controls:
The cutoff: with contamination=0.1, roughly the 10% most anomalous points are labeled outliers.
It shifts the predict() boundary; the raw score_samples() ranking is unaffected.
If set too high: Too many normal points flagged: false positives rise.
If set too low: Real anomalies slip through as inliers: false negatives rise.
Practical advice: Estimate it from domain knowledge or the true base rate; if unknown, work with the raw scores and choose a threshold from validation data.
Q37.What is novelty detection, and how does fitting a detector on known-clean data differ from unsupervised outlier detection on contaminated data?
Novelty detection trains a model on data assumed to be entirely normal, then flags any new point that deviates as a novelty; unsupervised outlier detection instead works on a single contaminated dataset and tries to isolate the anomalies already inside it.
Novelty detection (semi-supervised):
Assumption: the training set contains no outliers, so the model learns a clean notion of normal.
Two phases: fit on clean data, then judge unseen points at inference.
Unsupervised outlier detection:
Assumption: outliers are present but rare; the model must find them within the same data it's fit on.
Must be robust to the contamination it is trying to detect.
Why the distinction matters:
Contaminated training pulls the learned boundary toward the outliers, weakening detection (masking).
In scikit-learn the same estimator can do both: LocalOutlierFactor with novelty=True switches to novelty mode with a separate predict().
Q38.When would you use robust statistical methods like median over mean or MAE over MSE when dealing with outliers?
MAE over MSE when dealing with outliers?Reach for robust measures like the median or MAE whenever outliers are present and you want your estimate or loss to reflect the bulk of the data rather than be dragged toward extreme values. Mean and MSE square/average every deviation, so a few outliers dominate them.
Median over mean:
The median (50% breakdown) barely moves when a few points are extreme; the mean shifts arbitrarily.
Use for summarizing skewed or contaminated distributions (incomes, latencies).
MAE over MSE:
MSE squares errors, so a large residual dominates the loss and the model bends to fit outliers.
MAE weights errors linearly, keeping the fit anchored to the majority.
Huber loss is a middle ground: quadratic for small errors, linear for large ones.
When NOT to: If large errors are genuinely important to penalize, or data is clean and Gaussian, mean/MSE are more efficient and give a smooth, unique optimum.
Q39.Once you've identified outliers, what are the different strategies for handling or treating them, and what are the pros and cons of removing, capping/winsorizing, transforming, imputing, or keeping them and using robust methods?
There's no single fix: the right treatment depends on whether the outlier is an error or a genuine extreme, and each option trades bias against information loss. The main strategies are remove, cap/winsorize, transform, impute, or keep and use robust methods.
Remove (delete the rows):
Pro: simple, and correct when the point is a confirmed error or contamination.
Con: loses data, can bias results and shrink your sample; deleting genuine extremes hides real behavior.
Cap / winsorize (clip to a percentile):
Pro: keeps the record while limiting the influence of extreme values; good for heavy-tailed features.
Con: distorts the true value and understates real variability; the cap threshold is somewhat arbitrary.
Transform (e.g. log, Box-Cox):
Pro: compresses long right tails so extremes stop dominating, without dropping anything.
Con: changes interpretation/units, only helps skew-driven outliers, and fails on zeros/negatives (for log).
Impute (treat as missing, then fill):
Pro: sensible when the value is clearly wrong but the row is otherwise useful; keeps sample size.
Con: fabricates data and can inject bias if the imputation model is off or the value wasn't actually an error.
Keep and use robust methods:
Pro: no data altered; use median/IQR, robust regression (Huber), or tree models that resist extremes.
Con: not every method has a robust variant, and true errors still contaminate the analysis.
Rule of thumb: confirmed error, remove or impute; genuine extreme, keep with robust methods, cap, or transform.
Q40.Why is it generally recommended to investigate outliers first rather than immediately removing them?
Because an outlier is often the most informative point in the dataset, and removing it blindly can destroy signal or hide a real problem. Investigation tells you whether it's an error to fix or a genuine phenomenon to model.
An outlier is a question, not a verdict:
It may be a data-entry error, a sensor glitch, a unit mismatch, or a truly rare real event.
Only investigation reveals which, and the treatment differs completely.
The outlier may be the target: In fraud, intrusion, or failure detection, the anomaly is exactly what you're trying to find: deleting it defeats the purpose.
Deleting hides root causes: An extreme value can flag a broken pipeline or process bug; removing it silences the alarm.
Blind removal biases results: Trimming inconvenient points inflates model fit and can amount to fitting the story you wanted.
Q41.What is percentile or quantile capping/trimming, and when would you use it for outlier treatment?
Percentile capping (winsorizing) replaces values beyond chosen quantiles with the value at those quantiles; percentile trimming instead deletes them. Both bound the influence of extremes based on the data's own distribution rather than a hard-coded limit.
How capping works:
Pick lower/upper quantiles (e.g. 1st and 99th percentile).
Any value below the lower bound is set to the lower bound; anything above the upper is set to the upper.
Capping vs trimming:
Capping keeps the row (preserves sample size) but changes the value.
Trimming drops the row entirely (loses data).
When to use it:
Heavy-tailed features (income, transaction amounts) where a few extremes dominate means/variance.
When you want to reduce outlier influence but can't justify deleting records.
Cautions:
The percentile choice is arbitrary; too aggressive a cap erases real signal.
Fit the caps on training data only, then apply to test data, to avoid leakage.
Q42.What is the importance of domain and business rules in identifying and handling outliers?
Statistics can flag a point as unusual, but only domain and business knowledge can say whether it's impossible, implausible, or perfectly valid. Rules encode expertise that pure math can't infer and prevent both false alarms and missed errors.
Defines what is even possible: A negative age or a 200% discount is invalid regardless of distribution: a hard business rule catches it instantly.
Separates valid extremes from errors: A billion-dollar transaction is a statistical outlier but normal for institutional clients; domain context prevents wrongly deleting it.
Sets meaningful thresholds: Medical/engineering limits (safe temperature, valid heart rate) beat arbitrary statistical cutoffs.
Determines the cost of being wrong: Missing a fraud case vs a false alert have very different business costs, which should drive how aggressively you flag and treat outliers.
Q43.What are the analytic and ethical risks — including survivorship bias — of deleting inconvenient data points?
Deleting inconvenient data isn't a neutral cleanup step: it can systematically distort conclusions and, in high-stakes settings, cause real harm. Survivorship bias is the classic trap where you only analyze the points that remained, drawing confident but wrong conclusions.
Survivorship bias:
If you drop the failures/dropouts, the survivors look healthier than reality (e.g. only-successful funds make returns look great).
The WWII bombers example: reinforcing where returning planes were hit ignores the planes that never came back.
Analytic risks:
Underestimated variance and overstated model performance (the hard cases are gone).
P-hacking: removing points until the result turns significant.
Ethical risks:
Deleting outliers can drop minority or edge-case populations, baking unfairness into the model.
In safety-critical domains (medicine, finance) suppressing anomalies can hide the very failures that matter most.
Mitigations: Document every exclusion and its justification, and report results with and without the points.
Q44.You find outliers in your dataset — walk me through what you do, step by step.
I don't delete anything reflexively. I verify the outliers are real, diagnose their cause, decide on treatment based on that cause, and document what I did so it's reproducible and defensible.
1. Confirm and quantify: Check how many points, in which features, and by which method they were flagged; visualize (box plot, scatter, histogram).
2. Diagnose the cause: Data-entry/measurement error? Unit or encoding issue? A genuine rare event? Trace it back to the source if possible.
3. Apply domain and business rules: Is the value even possible? Does context make an extreme value legitimate?
4. Choose treatment to match the cause: Confirmed error: fix, impute, or remove. Genuine extreme: keep, cap, transform, or use robust methods.
5. Assess impact: Run the analysis/model with and without the treatment to see how sensitive results are.
6. Document: Record what was flagged, why, the treatment chosen, and its justification.
Q45.How does the asymmetric cost of a false alarm versus a missed outlier influence where you set your threshold?
The threshold is an economic decision: you slide it toward more or fewer alarms until the marginal cost of an extra false alarm equals the marginal cost of an extra miss. Asymmetric costs push the optimum away from any "default" cutoff.
Costly misses (fraud, equipment failure, disease):
Lower the threshold to raise recall, accepting more false positives.
Justified when one missed outlier costs far more than investigating many benign flags.
Costly false alarms (manual review, alert fatigue, halting a line): Raise the threshold to protect precision, accepting some misses.
Make it explicit with an expected-cost objective:
Minimise C_fp * FP + C_fn * FN over candidate thresholds using a labelled or estimated validation set.
The optimal cutoff depends on both the cost ratio and the anomaly prevalence.
Practical framing: Often set by an alarm budget (how many cases analysts can review) rather than a probability, which implicitly encodes the cost trade-off.
Q46.Can you list and explain different conceptual methods for outlier detection, such as statistical, proximity-based, and clustering-based approaches?
Outlier detection methods fall into a few conceptual families, each defining "normal" differently: statistical methods by distribution, proximity methods by neighbours, density methods by local concentration, clustering methods by cluster membership, and model-based methods by a learned notion of normality.
Statistical:
Fit a distribution and flag low-probability points (z-score, modified z-score with MAD, Grubbs, Gaussian mixtures).
Outlier = tail event under the assumed model.
Proximity / distance-based:
Score by distance to the k-th nearest neighbour or number of neighbours within a radius.
Outlier = far from its neighbours.
Density-based:
Compare a point's local density to its neighbours' (LOF, DBSCAN noise points, KDE).
Outlier = sits in a sparser region than its neighbourhood, capturing local anomalies.
Clustering-based: Cluster the data; points in no cluster, tiny clusters, or far from any centroid are anomalies.
Model-based / learning-based:
Learn a boundary or reconstruction of normality: Isolation Forest, one-class SVM, autoencoder reconstruction error.
Outlier = hard to isolate, outside the boundary, or poorly reconstructed.
Q47.How can a single outlier create or destroy an apparent correlation between two variables?
Correlation (especially Pearson's) is a global least-squares quantity and is highly non-robust, so one extreme point can pull the fitted relationship toward or away from itself, manufacturing a correlation that isn't really there or masking one that is.
Creating a spurious correlation: An otherwise uncorrelated cloud of points plus one far-off point aligned diagonally can push Pearson's r near 1, because that leverage point dominates the sums of products.
Destroying a real correlation: A tight linear relationship can be flattened toward r near 0 by a single point placed off the trend, inflating the variance and canceling the covariance signal.
Why it happens: Pearson uses squared deviations, so a high-leverage point far from the mean contributes disproportionately (breakdown point is essentially 0).
Defenses:
Always plot a scatterplot (Anscombe's quartet is the classic warning).
Use robust alternatives: Spearman rank correlation, or robust covariance estimators like MCD.
Q48.What is the difference between an outlier in the outcome, a high-leverage point in the predictors, and an influential point?
In a regression context these describe three different ways a point can be unusual: an outlier deviates in the response (y), a high-leverage point is extreme in the predictors (x), and an influential point is one whose removal materially changes the fitted model. A point can be any one, two, or all three.
Outlier in the outcome: Large residual: the observed y is far from the model's prediction, but its x may be typical.
High-leverage point: Extreme in predictor space (far from the mean of x), measured by the hat value; it has potential to pull the fit.
Influential point:
Actually changes coefficients when removed, typically requiring both high leverage and a large residual.
Measured with Cook's distance, DFFITS, or DFBETAS.
Key relationship: High leverage alone isn't harmful if the point follows the trend; danger comes when leverage and a large residual combine to create influence.
Q49.Explain the concept of a Z-score and how it is used to detect outliers, including its assumptions, limitations, and the masking effect.
A Z-score measures how many standard deviations a point lies from the mean; points beyond a threshold (commonly |z| > 3) are flagged as outliers because they are improbable under a normal distribution.
Definition: z = (x - mean) / std; a z of 3 means the value is 3 std devs from the mean.
Assumptions:
Data is approximately normally distributed and roughly symmetric.
Under normality, ~99.7% of data lies within ±3 std devs, so |z| > 3 is rare.
Limitations:
Mean and std are themselves not robust: outliers inflate the std and shift the mean.
Poor on skewed, heavy-tailed, or small samples.
Masking effect:
One or more extreme outliers inflate the std so much that their own z-scores fall below the threshold, hiding them and often hiding neighbors too.
Remedy: use the robust modified Z-score (median/MAD).
Q50.Explain the concept of a modified Z-score using the median and Median Absolute Deviation (MAD), and why it is considered more robust than the standard Z-score.
The modified Z-score replaces the mean and standard deviation with the median and the Median Absolute Deviation (MAD), which are resistant to extreme values, so outliers no longer distort the very statistics used to detect them.
Formula:
MAD = median(|x - median(x)|).
M_i = 0.6745 * (x - median) / MAD; the 0.6745 scales MAD to be consistent with the std under normality.
Common threshold: flag when |M_i| > 3.5.
Why more robust:
Median has a breakdown point of 50%: half the data can be corrupted before it shifts drastically, versus the mean which moves with a single outlier.
MAD is not inflated by extreme values the way std is, so it avoids the masking effect.
Caveat: if more than half the values are identical, MAD can be 0 (division problem); use a fallback like the mean absolute deviation.
Q51.How do you choose among Z-score, modified Z-score, and IQR rules based on sample size, skew, tail weight, and the expected number of outliers?
Z-score, modified Z-score, and IQR rules based on sample size, skew, tail weight, and the expected number of outliers?Match the rule's assumptions to your data: use Z-score only for large, roughly symmetric, light-tailed samples with few outliers; prefer the modified Z-score (median/MAD) when outliers or small samples would corrupt the mean and SD; and use IQR as a robust distribution-free default, switching to skew-adjusted variants when the data is asymmetric.
Z-score:
Best for large n, approximately normal, light tails, and few outliers.
Breaks down with masking: several outliers inflate the SD and hide each other.
Modified Z-score:
Uses the median and MAD instead of mean and SD, so it's robust for small samples and when many outliers are expected (flag |Mᵢ| > 3.5).
Handles heavier tails better than Z but still assumes rough symmetry.
IQR / Tukey:
Robust, distribution-free, good general default across sample sizes.
For skewed or heavy-tailed data, use the adjusted boxplot (medcouple) rather than symmetric fences.
Decision drivers:
Small n or many outliers: avoid mean/SD, favor MAD or IQR.
Strong skew: skew-adjusted boxplot or transform first.
Heavy tails: either model the tail or transform, since all these rules over-flag legitimate extremes.
Q52.Why is the IQR rule skew-sensitive, and what is the adjusted boxplot or medcouple approach for skewed data?
IQR rule skew-sensitive, and what is the adjusted boxplot or medcouple approach for skewed data?The IQR rule applies symmetric fences (same 1.5·IQR on both sides), but a skewed distribution has an inherently longer tail on one side, so the natural spread of the long tail exceeds the fence and gets over-flagged while the short tail is barely checked. The adjusted boxplot fixes this by scaling the fences with the medcouple, a robust measure of skewness.
Why symmetric fences fail on skew:
IQR captures the central spread but assumes both tails extend equally; on right-skewed data legitimate large values pile up past the upper fence.
Result: false positives on the heavy side, false negatives on the light side.
The medcouple (MC): A robust, quartile-based skewness statistic in [-1, 1]; 0 means symmetric, positive means right-skewed.
Adjusted boxplot fences (Hubert & Vandervieren):
Multiply the 1.5·IQR span by exponential factors in MC so the fence on the long-tail side stretches out and the short side tightens.
Typical form: [Q1 - 1.5·e^(-4·MC)·IQR, Q3 + 1.5·e^(3·MC)·IQR] for MC ≥ 0.
When to use it: Moderately skewed data where you want robustness without transforming; for extreme skew, transform first.
Q53.How do you tell an outlier apart from a legitimately heavy-tailed distribution where extreme values are expected?
The distinction is about whether an extreme value belongs to the data-generating process or comes from a different one: heavy-tailed distributions produce extremes as a natural, frequent consequence of their shape, whereas a true outlier is anomalous relative to any plausible model. You separate them by examining the tail's structure, not just individual points.
Look at the whole tail, not one point:
A Q-Q plot against a heavy-tailed reference (t, lognormal, Pareto): if extremes fall on a smooth curved line, they're the tail; if a few points jump off an otherwise straight line, they're outliers.
Heavy tails give many gradually increasing extremes; outliers give isolated gaps.
Fit and compare distributions: If a heavy-tailed model fits well, extremes are expected; only points inconsistent with that fit are candidates.
Use tail-aware tools: Extreme value theory (POT / peaks-over-threshold, generalized Pareto) models the tail explicitly and estimates how rare an extreme really is.
Domain reasoning: Physical/business plausibility: an income of $10M is a real heavy-tail draw; a negative age is an error. Context, not just magnitude, decides.
Stability check: If "outliers" recur every batch and scale with sample size, they're the tail; genuine outliers are rarer and often traceable to a cause.
Q54.Explain the generalised ESD test and how it differs from Grubbs when you expect more than one outlier.
The generalised ESD (Extreme Studentized Deviate) test extends Grubbs to detect up to a pre-specified maximum number of outliers without needing to know the exact count in advance, which avoids the masking problem that cripples a single Grubbs test.
How it works:
You set an upper bound k on the number of outliers.
It computes a Grubbs-like statistic R_i, removes the most extreme point, recomputes mean/std, and repeats k times.
Each R_i is compared to a critical value lambda_i that accounts for the shrinking sample; the largest i where R_i > lambda_i determines how many outliers exist.
How it differs from Grubbs:
Grubbs tests exactly one outlier; ESD tests a range up to k.
By removing points iteratively before recomputing, ESD resists masking (where several outliers inflate the std and hide one another).
The critical values are adjusted so the overall Type I error stays controlled across the k tests.
Assumptions: Approximately normal underlying data and a reasonable choice of k (overestimating k slightly is safe).
Q55.When you apply an outlier test to every point in a dataset, what multiple-comparison problem arises and how do you account for it?
Testing every point means running many hypothesis tests at once, so even at a fixed per-test error rate the chance of at least one false positive grows with the number of tests: the multiple-comparison problem inflates the family-wise error rate.
The core problem:
At alpha = 0.05 per test, with n independent tests the probability of a false alarm is 1 - (1 - 0.05)^n, which approaches 1 as n grows.
You end up flagging normal points as outliers purely by chance.
Ways to account for it:
Bonferroni correction: use alpha/n per test to bound the family-wise error rate (conservative).
Benjamini-Hochberg: control the false discovery rate (expected fraction of false flags), which is more powerful for many tests.
Use tests designed for the problem: generalised ESD builds the adjusted critical values in, so the overall error is controlled across its k iterations.
Takeaway: Never apply a single-point test naively to every observation; correct the threshold or use a method that accounts for the number of comparisons.
Q56.Explain the working principle of Local Outlier Factor (LOF), and why is the concept of local density crucial for it?
LOF), and why is the concept of local density crucial for it?Local Outlier Factor scores each point by comparing its local density to the densities of its neighbors: a point in a much sparser region than its neighbors gets a high LOF and is flagged as an outlier. The local view is what lets it find outliers relative to their surroundings rather than globally.
How the score is built:
Find each point's k-nearest neighbors and its reachability distance to them.
Compute local reachability density (lrd): roughly the inverse of the average reachability distance to neighbors.
LOF = average ratio of the neighbors' lrd to the point's own lrd.
Interpreting LOF:
LOF ~ 1: density similar to neighbors (inlier).
LOF >> 1: the point is much less dense than its neighbors (outlier).
Why local density matters:
Real datasets have clusters of differing densities; a global distance threshold would miss outliers near a dense cluster or falsely flag sparse-cluster members.
By judging each point against its own neighborhood, LOF adapts to varying density and detects context-dependent (local) outliers.
Q57.Explain the concept of Mahalanobis distance and why it is preferred over Euclidean distance for multivariate outlier detection when features are correlated.
Mahalanobis distance measures how far a point is from the distribution's centroid while accounting for the covariance of the features: it scales and rotates the space so correlated, differently scaled dimensions are treated fairly, whereas Euclidean distance ignores this and misjudges outliers.
The formula:
D^2 = (x - mu)^T * S^-1 * (x - mu), where mu is the mean vector and S is the covariance matrix.
The inverse covariance S^-1 effectively whitens the data (decorrelating and standardizing it).
Why it beats Euclidean with correlated features:
Euclidean treats every direction equally, so it ignores that data spreads more along correlated axes; a point along the correlation direction looks far when it's actually typical.
Mahalanobis contracts high-variance/correlated directions and expands low-variance ones, so distance reflects statistical unusualness, not raw coordinates.
It's also scale-invariant: features in different units don't dominate.
Outlier decision: Under multivariate normality, D^2 follows a chi-squared distribution with degrees of freedom equal to the number of features; compare against a chi-squared cutoff to flag outliers.
Caveats: The mean and covariance are themselves distorted by outliers; use robust estimators (e.g. Minimum Covariance Determinant) for reliability.
Q58.What does the chi-square cutoff mean when using Mahalanobis distance to flag multivariate outliers?
Q59.Mahalanobis distance has its own masking problem — how do the Minimum Covariance Determinant and elliptic envelope address it?
Q60.Describe the intuition behind Isolation Forest for detecting outliers, and why anomalies are typically isolated in fewer splits than normal data points.
Q61.Conceptually, how can PCA or autoencoder reconstruction error be used as an outlier detector?
Q62.Explain how One-Class SVM works for anomaly detection and its underlying principle for identifying novelties.
Q63.How do masking and swamping affect outlier detection, and how can they be mitigated?
Q64.Explain the concept of robust statistics and why robust methods are important in the context of outlier detection and modeling.
Q65.What is the breakdown point of a robust estimator like the Median Absolute Deviation (MAD)?
MAD)?Q66.Given that outliers are often rare and unlabelled, how would you evaluate the performance of an outlier detection model, and why is accuracy often a misleading metric?
Q67.How do you choose an appropriate threshold or contamination rate for an outlier detector?
Q68.Why is precision-at-k, recall, or PR-AUC preferred over ROC-AUC when evaluating an outlier detector under extreme class imbalance?
Q69.How can you validate an outlier detector using injected or synthetic anomalies when you have no labels?
Q70.Why and how would you ensemble multiple outlier detectors, and what is the role of score normalisation when combining them?
Q71.Why must you fit an outlier rule or threshold on the training set and apply it to test, and how does re-fitting on test cause leakage?
Q72.What are the key trade-offs to consider when choosing among different outlier detection methods (statistical, distance-based, density-based, model-based)?
Q73.How does the curse of dimensionality affect distance-based outlier detection methods?
Q74.How would you approach detecting outliers in time-series data, considering temporal dependencies?
Q75.How do you handle high-dimensional data in anomaly detection?
Q76.What is distance concentration, and why do subspace or feature-bagging methods help detect outliers in high dimensions?
Q77.Why does an IID outlier rule misfire on trending or seasonal time-series data, and what temporal methods address this?
IID outlier rule misfire on trending or seasonal time-series data, and what temporal methods address this?