Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bh-SNE with custom distance callback #48

Open
ypnos opened this issue Jun 12, 2018 · 3 comments
Open

bh-SNE with custom distance callback #48

ypnos opened this issue Jun 12, 2018 · 3 comments

Comments

@ypnos
Copy link
Contributor

ypnos commented Jun 12, 2018

Using method=tDistributedStochasticNeighborEmbedding in combination with withDistance() is not supported.

Laurens van der Maaten says for using a custom metric, the Vantage-Point Tree needs to be changed (see here. Note that this only refers to the Barnes-Hut algorithm; exact algorithm uses no VPTree and has it's own custom distance computation in tsne.hpp.

Interestingly, tapkee already comes with an alternative VPTree implementation that supports the use of a distance callback. It also looks quite compatible.

Could the method be altered to use the functionality of neighbors/vptree.hpp and enable withDistance()?

@ypnos
Copy link
Contributor Author

ypnos commented Jun 12, 2018

We would need a search method in VantagePointTree that also returns the distances, e.g.:

std::vector<std::pair<IndexType, double>> search(const RandomAccessIterator& target, int k)

And then in the method basically only replace one line:

results.push_back({items[heap.top().index]-begin, heap.top().distance});

@lisitsyn
Copy link
Owner

That looks promising, thanks for your suggestions!

I do not have good understanding what would happen if we use non-euclidean distance. Have to check.

@ypnos
Copy link
Contributor Author

ypnos commented Jun 13, 2018

I think for some data with special characteristics it could be beneficial to try L1 or EMD. But I need to see myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants