Skip to content

Methods · Machine learning · Metric learning

Neighbourhood Components Analysis

Neighbourhood components analysis learns a linear transformation of the features under which a nearest-neighbour classifier works best. It maximises the expected number of rows that would be classified correctly if each row picked a neighbour at random, with closer rows more likely to be picked. The learned map shows which features matter for telling classes apart and can reduce the number of dimensions.

이웃 성분 분석은 최근접 이웃 분류가 가장 잘 되도록 특성의 선형 변환을 학습합니다. 각 행이 가까울수록 뽑힐 가능성이 큰 이웃 하나를 무작위로 고른다고 할 때 바르게 분류되는 행 수의 기대값을 최대로 합니다. 학습된 변환은 범주를 가르는 데 중요한 특성을 보여 주고 차원을 줄이는 데도 쓸 수 있습니다.

Can I learn a distance between rows that makes nearest-neighbour classification more accurate, and which features does it emphasise?

최근접 이웃 분류를 더 정확하게 만드는 행 사이의 거리를 학습할 수 있고, 그 거리는 어떤 특성을 중시합니까?

The method reports the expected leave-one-out accuracy before and after learning the map, cross-validated k-nearest-neighbour accuracy with ordinary and learned distances, the map itself and a relevance score per feature.

When to use Neighbourhood Components Analysis

When to use something else

Assumptions and requirements

What the analysis reports

How to report it

Neighbourhood components analysis raised the expected leave-one-out accuracy from [value] to [value]; 3-nearest-neighbour cross-validated accuracy was [value] in the learned space against [value] with Euclidean distance.

Related methods

How this method is validated

이 방법의 검증 근거

  • Independent computation. 1 reference test compares the results with SciPy and direct computations (formulas, enumeration or simulation) at a stated tolerance of 1e-3.

    독립 계산. SciPy·직접 계산(식·열거·모의실험) 대조 참조 시험 1건 통과(허용오차 1e-3).

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 Neighbourhood Components Analysis 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.

Method ID Q71120 · Reviewed 2026-10-25