{
  "id": 9588,
  "title": "Apache Spark MLlib Input format",
  "url": "/competitions/acquire-valued-shoppers-challenge/discussion/9588",
  "author_name": "Alexander Riggers",
  "post_date": "2014-06-27T15:06:21.493000",
  "votes": 0,
  "comment_count": 0,
  "views": 977,
  "content": "<p>Hello !</p>\n<p>I want to use MLlib from <a href=\"http://spark.apache.org/docs/latest/mllib-linear-methods.html#linear-support-vector-machine-svm\">Apache Spark</a>&nbsp;but have problems with the input format for the SVM regression.&nbsp;</p>\n<p>I used Trischlikons python script to generate features.&nbsp;Right now my train and test set for one customer looks like this in VowalWabbit format:</p>\n<p><code>1 '12262064 |f offer_quantity:1 <br>has_bought_brand_company:1 has_bought_brand_a:6.79 has_bought_brand_q_60:1.0 <br>has_bought_brand:2.0 has_bought_company_a:1.95 has_bought_brand_180:1.0 <br>has_bought_brand_q_180:1.0 total_spend:218.37 has_bought_brand_q:3.0 offer_value:1.5 <br>has_bought_brand_a_60:2.79 has_bought_brand_60:1.0 has_bought_brand_q_90:1.0 <br>has_bought_brand_a_90:2.79 has_bought_company_q:1.0 has_bought_brand_90:1.0 <br>has_bought_company:1.0 never_bought_category:1 has_bought_brand_a_180:2.79</code></p>\n\n<p>How can I read in the txt-file into Spark? What am I missing? Do I have to delete feature names?&nbsp;</p>\n\n<p>Kind regards,</p>\n<p>Alex</p>",
  "messages": [
    {
      "id": 49704,
      "postDate": "2014-06-27T15:06:21.493Z",
      "content": "<p>Hello !</p>\n<p>I want to use MLlib from <a href=\"http://spark.apache.org/docs/latest/mllib-linear-methods.html#linear-support-vector-machine-svm\">Apache Spark</a>&nbsp;but have problems with the input format for the SVM regression.&nbsp;</p>\n<p>I used Trischlikons python script to generate features.&nbsp;Right now my train and test set for one customer looks like this in VowalWabbit format:</p>\n<p><code>1 '12262064 |f offer_quantity:1 <br>has_bought_brand_company:1 has_bought_brand_a:6.79 has_bought_brand_q_60:1.0 <br>has_bought_brand:2.0 has_bought_company_a:1.95 has_bought_brand_180:1.0 <br>has_bought_brand_q_180:1.0 total_spend:218.37 has_bought_brand_q:3.0 offer_value:1.5 <br>has_bought_brand_a_60:2.79 has_bought_brand_60:1.0 has_bought_brand_q_90:1.0 <br>has_bought_brand_a_90:2.79 has_bought_company_q:1.0 has_bought_brand_90:1.0 <br>has_bought_company:1.0 never_bought_category:1 has_bought_brand_a_180:2.79</code></p>\n\n<p>How can I read in the txt-file into Spark? What am I missing? Do I have to delete feature names?&nbsp;</p>\n\n<p>Kind regards,</p>\n<p>Alex</p>"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "49704": ""
  }
}