1

I have a question please, concerning isomap on R, I use vegan package with a square matrix of distance : isomap(Dist, k=2) I still have this error:

Error in isomapdist(Dist); data arre fragmented.

I did not understand what that means ?

MLavoie
  • 9,671
  • 41
  • 36
  • 56
sam Black
  • 33
  • 2
  • 10
  • 2
    When asking for help, please provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). There's not always one cause for a particular error message. – MrFlick Dec 08 '16 at 16:21
  • Here is the square matrix of distance on google Drive : https://drive.google.com/file/d/0BzMljqv0BFFuMndSVVIyeENDTHc/view?usp=sharing – sam Black Dec 08 '16 at 17:08
  • And here is the line code ord <- isomap (Dist, k = 3) Thank you – sam Black Dec 08 '16 at 17:10
  • I've also found that increasing the value of `k` solved the problem. – m13op22 Nov 09 '22 at 19:43

2 Answers2

1

Isomap will compute the distance between points using a path between points using only k-nearest neighbors - in your case, three nearest neighbors. If your data consists of disconnected components, there may not be any path between points using only k-th nearest neighbors. Depending on what you are trying to accomplish, it may be good enough to break up your data into connected clusters and run isomap on each cluster.

I hope that this helps.

G5W
  • 36,531
  • 10
  • 47
  • 80
1

Use parameter epsilon instead of k, and tune it to a good value in order to succeed.

library(vegan)
iso <- isomap(d, ndim=1, epsilon=0.3)
GZ92
  • 151
  • 1
  • 10