{
  "id": 20940,
  "title": "Tips for fast prototyping in R",
  "url": "/competitions/facebook-v-predicting-check-ins/discussion/20940",
  "author_name": "",
  "post_date": "2016-05-13T16:39:41.253Z",
  "votes": null,
  "comment_count": 3,
  "views": 750,
  "content": "<p>I'm new to Kaggle and machine learning. I work in R. I want to experiment with different approaches, but I'm finding that things run way too slowly --- I haven't even finished a full prediction for test yet.</p>\n\n<p>When I work on data sets from my own field, I often subset to a tiny piece of it while developing methods, but I also know that it's important to get something representative. I have to use my intuition about the data to do this.</p>\n\n<p>I was wondering if others run into computational problems; if not, my programming is too slow (unoptimized code, e.g.). If not, what strategies do people use while experimenting with the data?</p>\n\n<p>Just trying to get a since of whether this is a common problem (this data set isn't even <em>that</em> big), or how others work around it. Any commiseration or insight appreciated :)</p>",
  "messages": [
    {
      "id": "119903",
      "postDate": "05/13/2016 16:39:41",
      "content": "<p>I'm new to Kaggle and machine learning. I work in R. I want to experiment with different approaches, but I'm finding that things run way too slowly --- I haven't even finished a full prediction for test yet.</p>\n\n<p>When I work on data sets from my own field, I often subset to a tiny piece of it while developing methods, but I also know that it's important to get something representative. I have to use my intuition about the data to do this.</p>\n\n<p>I was wondering if others run into computational problems; if not, my programming is too slow (unoptimized code, e.g.). If not, what strategies do people use while experimenting with the data?</p>\n\n<p>Just trying to get a since of whether this is a common problem (this data set isn't even <em>that</em> big), or how others work around it. Any commiseration or insight appreciated :)</p>",
      "rawMarkdown": "I'm new to Kaggle and machine learning. I work in R. I want to experiment with different approaches, but I'm finding that things run way too slowly --- I haven't even finished a full prediction for test yet.\r\n\r\nWhen I work on data sets from my own field, I often subset to a tiny piece of it while developing methods, but I also know that it's important to get something representative. I have to use my intuition about the data to do this.\r\n\r\nI was wondering if others run into computational problems; if not, my programming is too slow (unoptimized code, e.g.). If not, what strategies do people use while experimenting with the data?\r\n\r\nJust trying to get a since of whether this is a common problem (this data set isn't even *that* big), or how others work around it. Any commiseration or insight appreciated :)",
      "votes": null
    },
    {
      "id": "119905",
      "postDate": "05/13/2016 17:02:26",
      "content": "<p>I am new to this kind of problem too so this is by no means an expert opinion, but here's what I've been doing so far:</p>\n\n<p>Given that the test data is an out-of-time sample, I am using an out-of-time sample for validation too. The train data contains the first 78 weeks of records (assuming &quot;time&quot; is in minutes), and the test data contains everything after that. I am using the final week of the training data as a validation set, ie where: train_data$time &gt;= 77*7*24*60. This gives about 1.6% of the training data as a holdout sample. I think it's important to have at least 1 week of data to reflect the whole of the weekly cycle.</p>\n\n<p>My code can probably stand to be much more efficient too, but my models currently take ~4 minutes to fit and validate on this holdout sample so I have been able to test a good number of iterations already. Running the same models on the test data takes considerably longer, so it will be good to avoid using the leaderboard for validation.</p>\n\n<p>I started with the &quot;class&quot; implementation of knn, but have moved to using the package FNN to fit knn models with the kd_tree algorithm - this sped things up considerably too.</p>",
      "rawMarkdown": "I am new to this kind of problem too so this is by no means an expert opinion, but here's what I've been doing so far:\r\n\r\nGiven that the test data is an out-of-time sample, I am using an out-of-time sample for validation too. The train data contains the first 78 weeks of records (assuming \"time\" is in minutes), and the test data contains everything after that. I am using the final week of the training data as a validation set, ie where: train_data$time >= 77*7*24*60. This gives about 1.6% of the training data as a holdout sample. I think it's important to have at least 1 week of data to reflect the whole of the weekly cycle.\r\n\r\nMy code can probably stand to be much more efficient too, but my models currently take ~4 minutes to fit and validate on this holdout sample so I have been able to test a good number of iterations already. Running the same models on the test data takes considerably longer, so it will be good to avoid using the leaderboard for validation.\r\n\r\nI started with the \"class\" implementation of knn, but have moved to using the package FNN to fit knn models with the kd_tree algorithm - this sped things up considerably too.",
      "votes": null
    },
    {
      "id": "123388",
      "postDate": "06/11/2016 15:53:19",
      "content": "<p>Hi,</p>\n\n<p>I am also new to this and I am trying to use KNN but how do I get list of likely places using KNN? knn function in package class gives only  the most likely place as output but we need to predict 3 places. Any help would be greatly appreciated.</p>\n\n<p>Regards,\nDheeraj</p>",
      "rawMarkdown": "Hi,\r\n\r\nI am also new to this and I am trying to use KNN but how do I get list of likely places using KNN? knn function in package class gives only  the most likely place as output but we need to predict 3 places. Any help would be greatly appreciated.\r\n\r\nRegards,\r\nDheeraj",
      "votes": null
    },
    {
      "id": "123960",
      "postDate": "06/14/2016 17:25:04",
      "content": "<p>to upstairs:\nI am new to  these too. But after several weeks findings, I think the keywords are: data.table, dplyr. Also for knn, FNN::knn is way more faster.</p>",
      "rawMarkdown": "to upstairs:\r\nI am new to  these too. But after several weeks findings, I think the keywords are: data.table, dplyr. Also for knn, FNN::knn is way more faster.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 119905,
      "author_name": "peatle",
      "author_url": "",
      "post_date": "05/13/2016 17:02:26",
      "content": "<p>I am new to this kind of problem too so this is by no means an expert opinion, but here's what I've been doing so far:</p>\n\n<p>Given that the test data is an out-of-time sample, I am using an out-of-time sample for validation too. The train data contains the first 78 weeks of records (assuming &quot;time&quot; is in minutes), and the test data contains everything after that. I am using the final week of the training data as a validation set, ie where: train_data$time &gt;= 77*7*24*60. This gives about 1.6% of the training data as a holdout sample. I think it's important to have at least 1 week of data to reflect the whole of the weekly cycle.</p>\n\n<p>My code can probably stand to be much more efficient too, but my models currently take ~4 minutes to fit and validate on this holdout sample so I have been able to test a good number of iterations already. Running the same models on the test data takes considerably longer, so it will be good to avoid using the leaderboard for validation.</p>\n\n<p>I started with the &quot;class&quot; implementation of knn, but have moved to using the package FNN to fit knn models with the kd_tree algorithm - this sped things up considerably too.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 123388,
      "author_name": "dheerajnitt",
      "author_url": "",
      "post_date": "06/11/2016 15:53:19",
      "content": "<p>Hi,</p>\n\n<p>I am also new to this and I am trying to use KNN but how do I get list of likely places using KNN? knn function in package class gives only  the most likely place as output but we need to predict 3 places. Any help would be greatly appreciated.</p>\n\n<p>Regards,\nDheeraj</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 123960,
      "author_name": "raingstar",
      "author_url": "",
      "post_date": "06/14/2016 17:25:04",
      "content": "<p>to upstairs:\nI am new to  these too. But after several weeks findings, I think the keywords are: data.table, dplyr. Also for knn, FNN::knn is way more faster.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "119903": "I'm new to Kaggle and machine learning. I work in R. I want to experiment with different approaches, but I'm finding that things run way too slowly --- I haven't even finished a full prediction for test yet.\r\n\r\nWhen I work on data sets from my own field, I often subset to a tiny piece of it while developing methods, but I also know that it's important to get something representative. I have to use my intuition about the data to do this.\r\n\r\nI was wondering if others run into computational problems; if not, my programming is too slow (unoptimized code, e.g.). If not, what strategies do people use while experimenting with the data?\r\n\r\nJust trying to get a since of whether this is a common problem (this data set isn't even *that* big), or how others work around it. Any commiseration or insight appreciated :)",
    "119905": "I am new to this kind of problem too so this is by no means an expert opinion, but here's what I've been doing so far:\r\n\r\nGiven that the test data is an out-of-time sample, I am using an out-of-time sample for validation too. The train data contains the first 78 weeks of records (assuming \"time\" is in minutes), and the test data contains everything after that. I am using the final week of the training data as a validation set, ie where: train_data$time >= 77*7*24*60. This gives about 1.6% of the training data as a holdout sample. I think it's important to have at least 1 week of data to reflect the whole of the weekly cycle.\r\n\r\nMy code can probably stand to be much more efficient too, but my models currently take ~4 minutes to fit and validate on this holdout sample so I have been able to test a good number of iterations already. Running the same models on the test data takes considerably longer, so it will be good to avoid using the leaderboard for validation.\r\n\r\nI started with the \"class\" implementation of knn, but have moved to using the package FNN to fit knn models with the kd_tree algorithm - this sped things up considerably too.",
    "123388": "Hi,\r\n\r\nI am also new to this and I am trying to use KNN but how do I get list of likely places using KNN? knn function in package class gives only  the most likely place as output but we need to predict 3 places. Any help would be greatly appreciated.\r\n\r\nRegards,\r\nDheeraj",
    "123960": "to upstairs:\r\nI am new to  these too. But after several weeks findings, I think the keywords are: data.table, dplyr. Also for knn, FNN::knn is way more faster."
  },
  "source": "meta"
}