Created
July 16, 2015 11:36
-
-
Save myui/ae5641704e6fdafed33a to your computer and use it in GitHub Desktop.
each_top_k.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table similarities | |
as | |
SELECT | |
each_top_k( | |
10, t2.id, angular_similarity(t2.features, t1.features), | |
t2.id, | |
t1.id, | |
t1.y | |
) as (rank, similarity, base_id, neighbor_id, y) | |
FROM | |
test_hivemall t2 | |
LEFT OUTER JOIN train_hivemall t1 | |
-- CROSS JOIN train_hivemall t1 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment