Skip to content

Instantly share code, notes, and snippets.

@yssymmt
Created September 19, 2022 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yssymmt/c96f055e203acd746084702596cc7637 to your computer and use it in GitHub Desktop.
Save yssymmt/c96f055e203acd746084702596cc7637 to your computer and use it in GitHub Desktop.
select
topicid,
word,
prob,
max(aa) over(partition by word) as pickbest,
dense_rank() over(partition by topicid order by prob desc) as ranko
from (
select
topicid,
word,
prob,
case when max(prob) over(partition by word)=prob then topicid else null end as aa
from jumbo.aud12_ldamodel
) a1
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment