Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
--Syntax
SELECT * FROM TF_IDF(
ON TF
(
ON {table|view|(query)} PARTITION BY docid
[FORMULA('bool'|'log'|'augment'|'normal')]
) AS TF PARTITION BY term
[ON (SELECT term, COUNT(distinct docid) FROM input_table
GROUP BY term) AS docperterm PARTITION BY term]
[ON (SELECT COUNT(distinct(docid)) FROM input_table)
AS doccount dimension]
[ON (SELECT DISTINCT(term) as term,
IDF FROM tf_idf_output_table) AS IDF PARTITION BY term]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.