Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Added ffm_features UDF #286

Merged
merged 1 commit into from
May 11, 2016
Merged

Added ffm_features UDF #286

merged 1 commit into from
May 11, 2016

Conversation

myui
Copy link
Owner

@myui myui commented May 11, 2016

ffm_features is a UDF to transform categorical variables to libffm feature vector format:
<field>:<feature>:<value>

select 
  c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26
from 
  train_raw
limit 1;

68fd1e64 80e26c9b fb936136 7b4723c4 25c83c98 7e0ccccf de7995b8 1f89b562 a73ee510 a8cd5504 b2cb9c98 37c9c164 2824a5f6 1adce6ef 8ba8b39a 891b62e7 e5ba7672 f54016b9 21ddcdc9 b1252a9d 07b5194c 3a171ecb c5c50484 e8b83407 9727dd16

select 
    ffm_features(
      array('c1','c2','c3','c4','c5','c6','c7','c8','c9','c10','c11','c12','c13','c14','c15','c16','c17','c18','c19','c20','c21','c22','c23','c24','c25','c26'),
      c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26
    ) as features
from
  train_raw
limit 1;

["c1:c1#68fd1e64:1","c2:c2#80e26c9b:1","c3:c3#fb936136:1","c4:c4#7b4723c4:1","c5:c5#25c83c98:1","c6:c6#7e0ccccf:1","c7:c7#de7995b8:1","c8:c8#1f89b562:1","c9:c9#a73ee510:1","c10:c10#a8cd5504:1","c11:c11#b2cb9c98:1","c12:c12#37c9c164:1","c13:c13#2824a5f6:1","c14:c14#1adce6ef:1","c15:c15#8ba8b39a:1","c16:c16#891b62e7:1","c17:c17#e5ba7672:1","c18:c18#f54016b9:1","c19:c19#21ddcdc9:1","c20:c20#b1252a9d:1","c21:c21#07b5194c:1","c23:c23#3a171ecb:1","c24:c24#c5c50484:1","c25:c25#e8b83407:1","c26:c26#9727dd16:1"]

@myui myui self-assigned this May 11, 2016
@myui myui added this to the v0.4 milestone May 11, 2016
@myui myui merged commit 667480e into master May 11, 2016
@myui myui deleted the feature/ffm branch May 13, 2016 03:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant