Large Margin Nearest Neighbour Metric Learning (LMNN)
Large margin nearest neighbour metric learning finds a linear transformation of the features so that each case's nearest same-class neighbours come close, while cases of other classes are pushed at least a unit margin farther away than those neighbours. The resulting Mahalanobis distance is designed for k-nearest-neighbour classification.
큰 마진 최근접 이웃 거리 학습은 각 사례의 같은 범주 최근접 이웃은 가까워지고, 다른 범주 사례는 그 이웃보다 최소한 단위 마진만큼 더 멀어지도록 특성의 선형 변환을 찾습니다. 그 결과 얻는 마할라노비스 거리는 k-최근접 이웃 분류에 맞게 설계됩니다.
Can I learn a distance under which each case's nearest neighbours mostly share its class?
각 사례의 가장 가까운 이웃이 대부분 같은 범주가 되도록 거리를 학습할 수 있습니까?
The method reports the learned distance matrix, the loss and number of margin violations before and after learning, and k-nearest-neighbour accuracy with the learned and the ordinary distance.
When to use Large Margin Nearest Neighbour Metric Learning (LMNN)
- A k-nearest-neighbour classifier is the end use and plain distances mix classes.
- Features differ in relevance and you want the data to set their weights and combinations.
When to use something else
- You want global pairwise distance bounds rather than local neighbourhoods: use Information-Theoretic Metric Learning (ITML)
- A linear boundary is enough: use Linear Discriminant Analysis
Assumptions and requirements
- Same-class target neighbours in the original space are meaningful
- Numeric features
- Each class has more cases than the number of target neighbours
What the analysis reports
- Learned Mahalanobis matrix
- Loss and active impostor triples before and after
- Leave-one-out and held-out k-NN accuracy
How to report it
LMNN (k = [value]) reduced the active impostor triples from [value] to [value]; leave-one-out [value]-NN accuracy changed from [value] (Euclidean) to [value].
Related methods
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with direct computations (formulas, enumeration or simulation) at a stated tolerance of 1e-5.
독립 계산. 직접 계산(식·열거·모의실험) 대조 참조 시험 1건 통과(허용오차 1e-5).
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Large Margin Nearest Neighbour Metric Learning (LMNN) on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable and predictor (feature) columns
- Price
- 600 credits for one analysis up to 10,000 rows (complexity level 4); larger or wider data costs more. Optional methodologist review: 2400 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.