Skip to content

Instantly share code, notes, and snippets.

@myui
Last active May 16, 2017 12:47
Show Gist options
  • Save myui/c229654faa37efcedb094f4fd43980e0 to your computer and use it in GitHub Desktop.
Save myui/c229654faa37efcedb094f4fd43980e0 to your computer and use it in GitHub Desktop.
select feature_hashing(array("userid#4505:3.3","movieid#2331:4.999", "movieid#2331"));

["1828616:3.3","6238429:4.999","6238429"]

SELECT
  features_hashing(
    array_concat(
      categorical_features(
          array('displayurl','adid','advetiserid','userid','gender'),
          displayurl,adid,advetiserid,userid,gender
      ),        
      quantitative_features(
          array('depth','position','age'),
          depth,position,age
      )
    )
  ) as features,
  label
FROM
  source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment