wildart / ManifoldLearning.jl

A Julia package for manifold learning and nonlinear dimensionality reduction
Other
92 stars 22 forks source link

Isomap nnType: Method error #30

Open FedeClaudi opened 2 years ago

FedeClaudi commented 2 years ago

Hey, thanks for this awesome package.

I'm trying to fit Isomap using nntype=KDTree from NearestNeighbors but I get a method error

image

The error line being NN = fit(nntype, X) here.

Any advice on how to get around this? Using brute force tree works but I'd like to find an easier solution. Also, is there a way to pass an already fitted tree? I'd like to re-use the same tree across different analysis steps.

Thank you

wildart commented 2 years ago

You cannot use directly KDTree. Here is the wrapper: https://github.com/wildart/ManifoldLearning.jl/blob/4568237cbf01841b65f1784e5f9ac357b8a27013/misc/nearestneighbors.jl#L9

FedeClaudi commented 2 years ago

I see, thank you. Perhaps its worth adding a warning in the docs, I took them to mean that you can just use any tree type from nearest neighbours!

wildart commented 2 years ago

Julia lets you carried away. I need to put a type check for AbstractNearestNeighbors there.