Deep k-Nearest Neighbours (DkNN)
Deep k-nearest neighbours trains a neural network and then, for a new case, looks up the most similar training cases in the representation of every hidden layer. How many of those neighbours disagree with each candidate label is turned into a conformal p-value using a held-out calibration set, giving a prediction together with its credibility.
신경망을 학습한 뒤 새 사례에 대해 각 은닉층의 표현에서 가장 비슷한 학습 사례를 찾는 방법입니다. 각 후보 이름표와 다른 이웃의 수를 보정용 자료로 등각 p값으로 바꾸어, 예측과 함께 그 예측의 신빙도를 줍니다.
Can I trust each of my neural network's predictions, and which inputs look unlike anything it was trained on?
신경망의 각 예측을 믿을 수 있는지, 학습 자료와 동떨어진 입력은 어느 것인지 알 수 있습니까?
Credibility near 1 means the training neighbours in every layer support the prediction; low credibility flags unusual inputs or conflicting evidence. The method reports accuracy for the deep kNN and the network itself and how credibility differs between correct and wrong predictions.
When to use Deep k-Nearest Neighbours (DkNN)
- You need a confidence signal for individual neural network predictions.
- You want to find inputs that differ from the training data.
When to use something else
- You need prediction sets with guaranteed coverage: use Conformal Classification Sets (Split, Mondrian, Adaptive Prediction Sets, Venn-Abers)
- A simple nearest-neighbour classifier is enough: use K-Nearest Neighbors (KNN)
Assumptions and requirements
- Training, calibration and test rows come from the same distribution
- Enough calibration rows for stable p-values
- Classification outcome
What the analysis reports
- Deep kNN and network test accuracy
- Credibility and confidence per prediction
- Accuracy by credibility bin
- Mean credibility for correct and incorrect predictions
How to report it
A deep k-nearest-neighbour classifier (k = [value] in each of [value] hidden layers) reached test accuracy [value]; mean credibility was [value] for correct and [value] for incorrect predictions.
Related methods
- K-Nearest Neighbors (KNN)
- Conformal Classification Sets (Split, Mondrian, Adaptive Prediction Sets, Venn-Abers)
- Conformal Prediction
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with direct computations (formulas, enumeration or simulation).
독립 계산. 직접 계산(식·열거·모의실험) 대조 참조 시험 1건 통과.
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 Deep k-Nearest Neighbours (DkNN) 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.