3 Distance outliers

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/26

encourage image

There's no tags or description

Looks like no tags are added yet.

27 Terms

1
New cards

What is Euclidean distance?

d2(x,y) = sqrt(∑_j (x_j - y_j)²). It is the straight-line distance between numerical vectors.

2
New cards

What is Manhattan distance?

d1(x,y) = ∑_j |x_j - y_j|. It sums absolute coordinate differences.

3
New cards

What is the Minkowski distance family?

d_q(x,y) = (∑_j |x_j - y_j|^q)^(1/q), q ≥ 1. q = 1 gives Manhattan distance; q = 2 gives Euclidean distance.

4
New cards

Example: find Euclidean and Manhattan distance between (1,2) and (4,6).

Coordinate differences are 3 and 4. Euclidean distance = sqrt(9 + 16) = 5; Manhattan distance = 3 + 4 = 7.

5
New cards

What is squared Mahalanobis distance from a reference mean?

D²(x) = (x - μ)^T * Σ^(-1) * (x - μ), where μ is the reference mean and Σ the reference covariance matrix. Mahalanobis distance D is sqrt(D²).

6
New cards

Why can Mahalanobis and Euclidean distance rank unusualness differently?

Mahalanobis distance accounts for variable scales and covariance. A small deviation across a low-variation direction can be more unusual than a larger deviation along a high-variation direction.

7
New cards

What conditions does the ordinary Mahalanobis formula require of the covariance matrix?

It must be suitably estimated and invertible. Classical estimates can be distorted by outliers, so the resulting distances depend on the reference fit.

8
New cards

What does R’s mahalanobis function return?

Squared Mahalanobis distance D². Compare that value to a chi-square quantile on the same squared-distance scale, not to the quantile’s square root.

9
New cards

How is a chi-square cutoff commonly used with squared Mahalanobis distance?

Under suitable multivariate-normal reference assumptions, flag when D² > χ²_(p,1-α), where p is the number of numerical features. Estimated parameters affect calibration.

10
New cards

Does a theoretical 90th-percentile chi-square cutoff force 10% of sample rows to be flagged?

No. The observed fraction depends on the data and calibration. Selecting a fixed number of highest anomaly scores by rank is a different policy.

11
New cards

In binary-vector comparison, what do f11, f00, f10 and f01 mean?

f11 counts shared presences; f00 shared absences; f10 and f01 count the two kinds of mismatch.

12
New cards

What is simple matching similarity for binary vectors?

SMC = (f11 + f00) / (f11 + f00 + f10 + f01). Both matching presences and matching absences contribute.

13
New cards

What is Jaccard similarity for binary vectors?

J = f11 / (f11 + f10 + f01). Shared absences are excluded; the denominator must be positive.

14
New cards

When is Jaccard often more informative than simple matching?

For sparse presence data such as purchases, where many shared absences should not dominate the comparison.

15
New cards

Example: two binary vectors share 2 presences, have 3 mismatches and 95 shared absences. What are SMC and Jaccard?

SMC = (2 + 95)/100 = 0.97. Jaccard = 2/(2 + 3) = 0.40. Their different treatment of shared absence explains the difference.

16
New cards

What is cosine similarity?

cos(x,y) = (x^T y) / (||x|| * ||y||), for nonzero vectors. It compares direction rather than total vector magnitude.

17
New cards

What is multidimensional scaling trying to preserve?

MDS constructs lower-dimensional coordinates that approximate the original dissimilarities. A 2D picture can distort relationships; its axes are constructed features.

18
New cards

Why do rotations or reflections of an MDS map not change its distance interpretation?

They preserve pairwise distances. The sign or compass direction of a constructed axis has no intrinsic scientific meaning.

19
New cards

What is the standard 1.5-IQR boxplot outlier rule?

Flag values below Q1 - 1.5IQR or above Q3 + 1.5IQR. A flag identifies unusualness under that rule, not a proven data-entry error.

20
New cards

Example: Q1 = 10 and Q3 = 18. What are the usual boxplot fences?

IQR = 8. Lower fence = 10 - 12 = -2; upper fence = 18 + 12 = 30. A value of 34 is flagged.

21
New cards

Why can pooled and subgroup-specific boxplots flag different rows?

Their reference distributions, quartiles and spreads differ. A value ordinary in the pooled data can be unusual within a particular group.

22
New cards

What is the central idea of isolation forest?

Unusual observations tend to be separated by fewer random partitions and have shorter isolation paths. It is an anomaly detector, rather than the supervised random-forest classifier.

23
New cards

If higher isolation scores mean more anomalous, what does lowering a fixed score cutoff do?

It flags at least as many observations, holding scores fixed. The score is not automatically the probability that a measurement is wrong.

24
New cards

What is the difference between a large residual, high leverage and influence?

A large residual is unusual response error; high leverage is an unusual predictor combination; influence means removing the point changes the fitted model substantially.

25
New cards

Can an observation have high leverage but a small residual?

Yes. It can have unusual predictor values but lie near the fitted line, possibly helping determine that line.

26
New cards

Example: detector A flags 12 rows, B flags 10, and 7 overlap. How many unique rows are flagged?

The union has 12 + 10 - 7 = 15 rows. Five are A-only and three are B-only. Agreement does not establish ground truth.

27
New cards