Now we wait - while BigQuery shows us the progress of our training:Īnd when it’s done, we even get an evaluation of our model: With this line, I’m creating a one-hot encoding string that I can use later to define the 4,000+ columns I’ll use for k-means: one_hot_big = client.query("""įORMAT("IFNULL(ANY_VALUE(IF(tag2='%s',1,null)),0)X%s", tag2, REPLACE(REPLACE(REPLACE(REPLACE(tag2,'-','_'),'.','D'),'#','H'),'+','P'))Īnd training a k-means model in BigQuery is really easy: CREATE MODEL `deleting.kmeans_tagsubtag_50_big_a_01` Now - instead of using this small table, let’s use the whole table to compute k-means with BigQuery. ,IFNULL(ANY_VALUE(IF(tag2='jquery',1,null)),0) XjqueryįROM `deleting.stack_overflow_tag_co_ocurrence` ,IFNULL(ANY_VALUE(IF(tag2='android',1,null)),0) Xandroid ,IFNULL(ANY_VALUE(IF(tag2='python',1,null)),0 ) Xpython ,IFNULL(ANY_VALUE(IF(tag2='javascript',1,null)),0) Xjavascript You can reduce or augment the sensibility of these relations with the percent threshold: SELECT tag1 ‘unit-testing’ a relation to almost every column here, except to ‘php’, ‘html’, ‘css’, and ‘jquery’. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |