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

Fixed ordering problems in neighbors (MLDB-1677) #387

Merged
merged 1 commit into from May 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions plugins/embedding.cc
Expand Up @@ -1236,8 +1236,7 @@ applyT(const ApplierT & applier_, NearestNeighborsInput input) const
else if(inputRow.isEmbedding() || inputRow.isRow()) {
auto embedding = applier.getEmbeddingFromExpr(inputRow);
neighbors = applier.embeddingDataset
->getNeighbors(inputRow.getEmbedding(-1),
numNeighbors, maxDistance);
->getNeighbors(embedding.cast<float>(), numNeighbors, maxDistance);
}
else {
throw ML::Exception("Input row must be either a row name or an embedding");
Expand Down
4 changes: 2 additions & 2 deletions testing/MLDB-466-full-reddit.py
Expand Up @@ -17,7 +17,7 @@ def test_pipeline(self):
'delimiter':'',
'quotechar':'',
'outputDataset': 'reddit_raw',
'limit': 5000,
'limit': 2000,
'runOnCreation': True
}
})
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_pipeline(self):

import math
# MLDB-1677
#self.assertEqual(math.sqrt(dist_accum), result["x.distance"])
self.assertLess(abs(math.sqrt(dist_accum) - result["x.distance"]), 0.00001)

mldb.put('/v1/procedures/reddit_kmeans', {
"type" : "kmeans.train",
Expand Down