{"action":"closed","issue":{"url":"https://api.github.com/repos/dmlc/xgboost/issues/619","labels_url":"https://api.github.com/repos/dmlc/xgboost/issues/619/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/xgboost/issues/619/comments","events_url":"https://api.github.com/repos/dmlc/xgboost/issues/619/events","html_url":"https://github.com/dmlc/xgboost/issues/619","id":116522264,"number":619,"title":"convert the text columns to libsvm format using feature hasher from scikit learn ?","user":{"login":"aliabbasjp","id":830792,"avatar_url":"https://avatars.githubusercontent.com/u/830792?v=3","gravatar_id":"","url":"https://api.github.com/users/aliabbasjp","html_url":"https://github.com/aliabbasjp","followers_url":"https://api.github.com/users/aliabbasjp/followers","following_url":"https://api.github.com/users/aliabbasjp/following{/other_user}","gists_url":"https://api.github.com/users/aliabbasjp/gists{/gist_id}","starred_url":"https://api.github.com/users/aliabbasjp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliabbasjp/subscriptions","organizations_url":"https://api.github.com/users/aliabbasjp/orgs","repos_url":"https://api.github.com/users/aliabbasjp/repos","events_url":"https://api.github.com/users/aliabbasjp/events{/privacy}","received_events_url":"https://api.github.com/users/aliabbasjp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-12T10:34:04Z","updated_at":"2016-01-15T05:21:25Z","closed_at":"2016-01-15T05:21:25Z","body":"https://github.com/zygmuntz/phraug/blob/master/csv2libsvm.py links to a code which only works for numeric data , but I have CSV file for machine learning which has mostly text data and most columns have a large cardinality , eg: a column with name of a person. Ideally would like to use the scikit learn's feature hasher or a vectorizer to generate the file in libsvm format hashing the text feature values to appropriate numeric values.\r\n\r\nNote:\r\n\r\nThe graphlab ML library takes inputs with non numeric values in its Sframe and the Sframe is used in the classifiers like xgboost. So it is already doing what I require but it is not opensource and we dont get the numeric table output from the sframe. Most likely graphlab is using some featurehasher internally to keep track of the mappings between the text values and numeric values.\r\n\r\nSo how to convert the text columns to libsvm format using feature hasher from scikit learn ?\r\n"}}