Nearest-Neighbour Distance Plot Calculator

Explore nearest-neighbour distances, identify DBSCAN epsilon candidates, compare distance metrics, scale multidimensional data, flag sparse observations, and export clear interactive results instantly online securely.

Calculating distances…

Calculated results

Ready

Nearest-neighbour distance plot

Use zoom, pan, hover, autoscale, and image tools.

DBSCAN guidance

Interpretation

Observation-level results

1. Data input

Paste comma, tab, semicolon, or space-separated data. The first row may contain headers.
Limits pairwise computation time.
Uncheck identifier, label, or unwanted columns.

Parsed-data preview

2. Neighbour and distance settings

The selected k is always included.

Scaled-data preview

3. Knee detection and smoothing

Current sensitivity: 5

4. Plot configuration

Formula used

Euclidean distance
d(xᵢ, xⱼ) = √[Σₘ(xᵢₘ − xⱼₘ)²]
Minkowski distance
d(xᵢ, xⱼ) = [Σₘ|xᵢₘ − xⱼₘ|ᵖ]¹⁄ᵖ

Each observation is compared with every other observation. Distances are sorted from smallest to largest. The selected neighbour summary becomes one plotted value.

How to use

  1. Paste numeric data or upload a CSV file.
  2. Parse the data and select feature columns.
  3. Choose k, scaling, and a distance metric.
  4. Configure smoothing and knee detection.
  5. Calculate and inspect the suggested epsilon.
  6. Export the chart, table, or PDF report.

Example data

XYPurpose
1.01.1Dense cluster
1.20.9Dense cluster
5.15.0Second cluster
5.45.2Second cluster
9.51.0Isolated observation

Frequently asked questions

What does the plot show?

It shows one neighbour-distance value for every observation. Values are sorted by rank. Sharp increases reveal sparser observations.

How does it help DBSCAN?

The curve can suggest an epsilon threshold. A knee often separates dense points. It does not guarantee ideal clusters.

Which k should I use?

A common starting point is four. Larger values create smoother curves. Domain knowledge should guide final selection.

Should I scale features?

Scaling is usually important. Large-range features can dominate distance. Standardisation often provides a useful baseline.

What if no knee appears?

The dataset may lack clear density separation. Try different metrics or scaling. Test several epsilon values afterward.

What are points above epsilon?

They may lie in sparse regions. Some can become DBSCAN noise. Context is needed before removal.

Can I use multidimensional data?

Yes, any numeric feature count works. Distance quality can weaken in high dimensions. Feature selection remains important.

Why remove duplicate observations?

Duplicates create zero distances. They can distort local-density interpretation. Keep them only when repetition is meaningful.

Is the suggested epsilon final?

No, it is an informed starting value. Validate resulting clusters and noise. Compare nearby epsilon settings carefully.

Related Calculators

Cluster Scatter PlotElbow PlotSilhouette PlotDendrogramCluster HeatmapCentroid PlotDistance Matrix HeatmapCluster Size Bar ChartCluster Profile Radar Chart

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.