DiffusionMapsAcademics / pyDiffMap

Library for diffusion maps
MIT License
47 stars 14 forks source link

Documentation issue #6

Closed ralfbanisch closed 6 years ago

ralfbanisch commented 6 years ago

The documentation of fit_transform in diffusion_map class in incorrect:

"Fits the data and returns diffusion coordinates. equivalent to calling dmap.fit(X).transform(x)."

fit_transform is NOT equivalent to calling dmap.fit(X).transform(x). It is equivalent (returns the same output) to dmap.fit(X).transform(X), but there is computational overhead in the latter.

fit_transform(X) takes X (array-like, shape (n_query, n_features)) and returns phi (numpy array, shape (n_query, n_eigenvectors)), which represents the diffusion map eigenvectors evaluated at the data X. dmap.fit(X).transform(x) returns diffusion coordinates evaluated at the query point(s) x based on the eigenvectors computed from X.

ehthiede commented 6 years ago

This is an issue with transform as well: .fit(x).transform(x) shouldn't be slower than .fit_transform(x). We should resolve this by adding "if Y == X: return self.dmaps" to transform so we aren't doing the expensive calculation (I just typed this though, so it probably doesn't work)

ralfbanisch commented 6 years ago

resolved as per commit b1790680cd95c19a4e678061520ee353466fdfe8

ralfbanisch commented 6 years ago

I'm closing this issue.