{
  "id": 899,
  "title": "import .svm.dat data into R",
  "url": "/competitions/SemiSupervisedFeatureLearning/discussion/899",
  "author_name": "",
  "post_date": "2011-09-29T03:17:54.603Z",
  "votes": null,
  "comment_count": 5,
  "views": 5856,
  "content": "<p>Hello, everyone here, is anyone willing to give an instruction on importing the train or test dataset .svm.dat into R? &nbsp;I am newbie in the SVM data format given that I had worked on R for years. I will appreciate any kind help here.</p>\r\n<p>&nbsp;</p>\r\n<p>Thanks in advance.</p>",
  "messages": [
    {
      "id": "5729",
      "postDate": "09/29/2011 03:17:54",
      "content": "<p>Hello, everyone here, is anyone willing to give an instruction on importing the train or test dataset .svm.dat into R? &nbsp;I am newbie in the SVM data format given that I had worked on R for years. I will appreciate any kind help here.</p>\r\n<p>&nbsp;</p>\r\n<p>Thanks in advance.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "5731",
      "postDate": "09/29/2011 06:37:30",
      "content": "<p>http://cran.r-project.org/web/packages/e1071/</p>\r\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "5733",
      "postDate": "09/29/2011 10:06:07",
      "content": "<div>\r\n<p>Downloaded, and installed the e1071, kernlab, and klaR packages. Also, downloaded the example1 data from the SVMLight package. Running the SVM on the example1 training data, give an &quot;Error: unexpected symbol . . . .&quot; &nbsp;</p>\r\n<p>&nbsp;I was expecting that the SVM functions would be able to read the SVMLight data format?</p>\r\n<blockquote>\r\n<p>svm<em>learn example1/train.dat example1/model<br>\r\nError: unexpected symbol in &quot;svm</em>learn example1&quot;<br>\r\nsvm<em>perf</em>learn -c 20 -l 2 --b 0 example1/train.dat example1/model&nbsp;<br>\r\nError: unexpected numeric constant in &quot;svm<em>perf</em>learn -c 20&quot;</p>\r\n</blockquote>\r\n</div>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "5736",
      "postDate": "09/29/2011 14:33:01",
      "content": "<p>George, I appreciated your help.</p>\r\n<p>It seems successful to read the .svmlight.dat with the function &quot;read.matrix.csr&quot; in the package you told &quot;e1071&quot;. Eventhougth, the reading finished with warning messages.&nbsp;(What I did: I loaded the &quot;e1071&quot; on R 12.1 and a likily sidekick package &quot;SparseM&quot;.\r\n The loading task functioned well given these package are all developed under R 12.2 )</p>\r\n<p>I did not know the exact looking of the data or R loaded the complete data set which I instructed it to do. Anyway, the loaded train data had 50,000 rows and &nbsp;<span class=\"x_x_x_Apple-style-span\" style=\"white-space:pre\">999,999 columns. It reasonable for\r\n the data with all labels missing.</span></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "5751",
      "postDate": "09/30/2011 01:49:57",
      "content": "<p>Hello Beingzy, &nbsp;Can you provide some more detail (maybe the exact command that you used) about reading the data set. &nbsp;I tried the read.matrix.csr command in the R (2.13.1) environment. &nbsp;But, so far, I have been unable to read the file.</p>\r\n<p>Thanks, george</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "5802",
      "postDate": "10/01/2011 10:03:28",
      "content": "<p>&gt; trainFile &lt;- paste(ssfl.data.win, &quot;\\\\public_train_data.svmlight.dat&quot;, sep=&quot;&quot;)<br>\r\n&gt; trainFile<br>\r\n[1] &quot;C:\\\\Docume~1\\\\Clyph\\\\MyDocu~1\\\\Work\\\\Analytics\\\\SSFL\\\\data\\\\public_train_data.svmlight.dat&quot;<br>\r\n&gt; train &lt;- read.matrix.csr(trainFile)<br>\r\nWarning message: closing unused connection 3<br>\r\n(C:\\Docume~1\\Clyph\\MyDocu~1\\Work\\Analytics\\SSFL\\data\\public_train_data.svmlight.dat)<br>\r\n&gt; ls()<br>\r\n[1] &quot;bmi&quot; &quot;height&quot; &quot;hh&quot; &quot;oops&quot; &quot;rrr&quot; &quot;ssfl.data.win&quot; &quot;train&quot;<br>\r\n[8] &quot;train.file&quot; &quot;trainFile&quot; &quot;vowel.train&quot; &quot;weight&quot; &quot;x&quot; &quot;xbar&quot;</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 5731,
      "author_name": "george11",
      "author_url": "",
      "post_date": "09/29/2011 06:37:30",
      "content": "<p>http://cran.r-project.org/web/packages/e1071/</p>\r\n<p>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 5733,
      "author_name": "george11",
      "author_url": "",
      "post_date": "09/29/2011 10:06:07",
      "content": "<div>\r\n<p>Downloaded, and installed the e1071, kernlab, and klaR packages. Also, downloaded the example1 data from the SVMLight package. Running the SVM on the example1 training data, give an &quot;Error: unexpected symbol . . . .&quot; &nbsp;</p>\r\n<p>&nbsp;I was expecting that the SVM functions would be able to read the SVMLight data format?</p>\r\n<blockquote>\r\n<p>svm<em>learn example1/train.dat example1/model<br>\r\nError: unexpected symbol in &quot;svm</em>learn example1&quot;<br>\r\nsvm<em>perf</em>learn -c 20 -l 2 --b 0 example1/train.dat example1/model&nbsp;<br>\r\nError: unexpected numeric constant in &quot;svm<em>perf</em>learn -c 20&quot;</p>\r\n</blockquote>\r\n</div>",
      "votes": null,
      "replies": []
    },
    {
      "id": 5736,
      "author_name": "beingzy",
      "author_url": "",
      "post_date": "09/29/2011 14:33:01",
      "content": "<p>George, I appreciated your help.</p>\r\n<p>It seems successful to read the .svmlight.dat with the function &quot;read.matrix.csr&quot; in the package you told &quot;e1071&quot;. Eventhougth, the reading finished with warning messages.&nbsp;(What I did: I loaded the &quot;e1071&quot; on R 12.1 and a likily sidekick package &quot;SparseM&quot;.\r\n The loading task functioned well given these package are all developed under R 12.2 )</p>\r\n<p>I did not know the exact looking of the data or R loaded the complete data set which I instructed it to do. Anyway, the loaded train data had 50,000 rows and &nbsp;<span class=\"x_x_x_Apple-style-span\" style=\"white-space:pre\">999,999 columns. It reasonable for\r\n the data with all labels missing.</span></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 5751,
      "author_name": "george11",
      "author_url": "",
      "post_date": "09/30/2011 01:49:57",
      "content": "<p>Hello Beingzy, &nbsp;Can you provide some more detail (maybe the exact command that you used) about reading the data set. &nbsp;I tried the read.matrix.csr command in the R (2.13.1) environment. &nbsp;But, so far, I have been unable to read the file.</p>\r\n<p>Thanks, george</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 5802,
      "author_name": "george11",
      "author_url": "",
      "post_date": "10/01/2011 10:03:28",
      "content": "<p>&gt; trainFile &lt;- paste(ssfl.data.win, &quot;\\\\public_train_data.svmlight.dat&quot;, sep=&quot;&quot;)<br>\r\n&gt; trainFile<br>\r\n[1] &quot;C:\\\\Docume~1\\\\Clyph\\\\MyDocu~1\\\\Work\\\\Analytics\\\\SSFL\\\\data\\\\public_train_data.svmlight.dat&quot;<br>\r\n&gt; train &lt;- read.matrix.csr(trainFile)<br>\r\nWarning message: closing unused connection 3<br>\r\n(C:\\Docume~1\\Clyph\\MyDocu~1\\Work\\Analytics\\SSFL\\data\\public_train_data.svmlight.dat)<br>\r\n&gt; ls()<br>\r\n[1] &quot;bmi&quot; &quot;height&quot; &quot;hh&quot; &quot;oops&quot; &quot;rrr&quot; &quot;ssfl.data.win&quot; &quot;train&quot;<br>\r\n[8] &quot;train.file&quot; &quot;trainFile&quot; &quot;vowel.train&quot; &quot;weight&quot; &quot;x&quot; &quot;xbar&quot;</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "5729": "",
    "5731": "",
    "5733": "",
    "5736": "",
    "5751": "",
    "5802": ""
  },
  "source": "meta"
}