{
  "id": 9415,
  "title": "categorical features in vowpal wabbit",
  "url": "/competitions/acquire-valued-shoppers-challenge/discussion/9415",
  "author_name": "",
  "post_date": "2014-06-08T11:31:36.057Z",
  "votes": null,
  "comment_count": 1,
  "views": 2543,
  "content": "<p>What is the best way to incorporate features which take finite values (like measure - OZ, CT, RL, LB etc) in VW&nbsp;?</p>\n\n<p>Thanks</p>",
  "messages": [
    {
      "id": "48859",
      "postDate": "06/08/2014 11:31:36",
      "content": "<p>What is the best way to incorporate features which take finite values (like measure - OZ, CT, RL, LB etc) in VW&nbsp;?</p>\n\n<p>Thanks</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "48862",
      "postDate": "06/08/2014 13:27:34",
      "content": "<p>Categorical features are features&nbsp;like &quot;male&quot; and &quot;female&quot;. You can sparsely encode these in VW like so:</p>\n<p><code></code><code>1 '001 |f sex_male city_london os_windows</code></p>\n\n<p>Which will be interpreted as:</p>\n\n<p><code>1 '001 |f sex_male:1 city_london:1 os_windows:1</code></p>\n\n<p>If you want to encode numerical features like measures in OZ, you can encode these in VW like so:</p>\n\n<p><code>-1 '023 |f oz:5.7 ct:1.333 lb:15.9</code></p>\n\n<p>See https://github.com/JohnLangford/vowpal_wabbit/wiki/Input-format for more information on the format.</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 48862,
      "author_name": "triskelion",
      "author_url": "",
      "post_date": "06/08/2014 13:27:34",
      "content": "<p>Categorical features are features&nbsp;like &quot;male&quot; and &quot;female&quot;. You can sparsely encode these in VW like so:</p>\n<p><code></code><code>1 '001 |f sex_male city_london os_windows</code></p>\n\n<p>Which will be interpreted as:</p>\n\n<p><code>1 '001 |f sex_male:1 city_london:1 os_windows:1</code></p>\n\n<p>If you want to encode numerical features like measures in OZ, you can encode these in VW like so:</p>\n\n<p><code>-1 '023 |f oz:5.7 ct:1.333 lb:15.9</code></p>\n\n<p>See https://github.com/JohnLangford/vowpal_wabbit/wiki/Input-format for more information on the format.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "48859": "",
    "48862": ""
  },
  "source": "meta"
}