{
  "id": 21951,
  "title": "KNN in R with manhattan distance",
  "url": "/competitions/facebook-v-predicting-check-ins/discussion/21951",
  "author_name": "",
  "post_date": "2016-06-29T05:45:57.600Z",
  "votes": 1,
  "comment_count": 3,
  "views": 791,
  "content": "<p>I've been very intrigued by how well KNN has done in this competition.  It's the first time I've seen that algorithm dominate, at least in the Kaggle scripts.  I've been learning a lot, but haven't found R KNN packages that rival what is coming out of python sklearn.  Are there any good KNN packages that are efficient and handle Manhattan distance?</p>\n\n<p>I've tried:</p>\n\n<ul>\n<li>FNN::knn  (Euclidiean only) </li>\n<li>knnGarden::knnVCN (slow)</li>\n<li>scrime::gknn   (can't handle more than 10 classes)</li>\n</ul>",
  "messages": [
    {
      "id": "125400",
      "postDate": "06/29/2016 05:45:57",
      "content": "<p>I've been very intrigued by how well KNN has done in this competition.  It's the first time I've seen that algorithm dominate, at least in the Kaggle scripts.  I've been learning a lot, but haven't found R KNN packages that rival what is coming out of python sklearn.  Are there any good KNN packages that are efficient and handle Manhattan distance?</p>\n\n<p>I've tried:</p>\n\n<ul>\n<li>FNN::knn  (Euclidiean only) </li>\n<li>knnGarden::knnVCN (slow)</li>\n<li>scrime::gknn   (can't handle more than 10 classes)</li>\n</ul>",
      "rawMarkdown": "I've been very intrigued by how well KNN has done in this competition.  It's the first time I've seen that algorithm dominate, at least in the Kaggle scripts.  I've been learning a lot, but haven't found R KNN packages that rival what is coming out of python sklearn.  Are there any good KNN packages that are efficient and handle Manhattan distance?\r\n\r\nI've tried:\r\n\r\n - FNN::knn  (Euclidiean only) \r\n - knnGarden::knnVCN (slow)\r\n - scrime::gknn   (can't handle more than 10 classes)",
      "votes": null
    },
    {
      "id": "125449",
      "postDate": "06/29/2016 15:15:09",
      "content": "<p>Check out <a href=\"https://cran.r-project.org/web/packages/RANN.L1/RANN.L1.pdf\">RANN.L1</a>.</p>\n\n<p>It doesn't have the features you find in python, but it gets the job done.</p>",
      "rawMarkdown": "Check out [RANN.L1][1].\r\n\r\nIt doesn't have the features you find in python, but it gets the job done.\r\n\r\n\r\n  [1]: https://cran.r-project.org/web/packages/RANN.L1/RANN.L1.pdf",
      "votes": null
    },
    {
      "id": "125469",
      "postDate": "06/29/2016 18:47:56",
      "content": "<p>I have used weighted knn classification using the kknn package with some good success. It allows general Minkowski distance and various weighting kernals. A nice R package for this competition to experiment with.</p>",
      "rawMarkdown": "I have used weighted knn classification using the kknn package with some good success. It allows general Minkowski distance and various weighting kernals. A nice R package for this competition to experiment with.",
      "votes": null
    },
    {
      "id": "125800",
      "postDate": "07/02/2016 20:22:45",
      "content": "<p>Thanks for the responses.</p>\n\n<p>@SK ... this was exactly what I needed.  Although it is  bare bones, it plugged into the functions I'd written for the FNN results.  Thanks!</p>\n\n<p>@Khurram - I wish I had discovered this earlier.  This looks like a very robust package, and will probably be my goto for KNN and R in the future.  There's a bit to look into here, and I probably won't get to it before contest end.  Thanks for sharing.</p>",
      "rawMarkdown": "Thanks for the responses.\r\n\r\n@SK ... this was exactly what I needed.  Although it is  bare bones, it plugged into the functions I'd written for the FNN results.  Thanks!\r\n\r\n@Khurram - I wish I had discovered this earlier.  This looks like a very robust package, and will probably be my goto for KNN and R in the future.  There's a bit to look into here, and I probably won't get to it before contest end.  Thanks for sharing.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 125449,
      "author_name": "optimism",
      "author_url": "",
      "post_date": "06/29/2016 15:15:09",
      "content": "<p>Check out <a href=\"https://cran.r-project.org/web/packages/RANN.L1/RANN.L1.pdf\">RANN.L1</a>.</p>\n\n<p>It doesn't have the features you find in python, but it gets the job done.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 125469,
      "author_name": "knadeem",
      "author_url": "",
      "post_date": "06/29/2016 18:47:56",
      "content": "<p>I have used weighted knn classification using the kknn package with some good success. It allows general Minkowski distance and various weighting kernals. A nice R package for this competition to experiment with.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 125800,
      "author_name": "datadave",
      "author_url": "",
      "post_date": "07/02/2016 20:22:45",
      "content": "<p>Thanks for the responses.</p>\n\n<p>@SK ... this was exactly what I needed.  Although it is  bare bones, it plugged into the functions I'd written for the FNN results.  Thanks!</p>\n\n<p>@Khurram - I wish I had discovered this earlier.  This looks like a very robust package, and will probably be my goto for KNN and R in the future.  There's a bit to look into here, and I probably won't get to it before contest end.  Thanks for sharing.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "125400": "I've been very intrigued by how well KNN has done in this competition.  It's the first time I've seen that algorithm dominate, at least in the Kaggle scripts.  I've been learning a lot, but haven't found R KNN packages that rival what is coming out of python sklearn.  Are there any good KNN packages that are efficient and handle Manhattan distance?\r\n\r\nI've tried:\r\n\r\n - FNN::knn  (Euclidiean only) \r\n - knnGarden::knnVCN (slow)\r\n - scrime::gknn   (can't handle more than 10 classes)",
    "125449": "Check out [RANN.L1][1].\r\n\r\nIt doesn't have the features you find in python, but it gets the job done.\r\n\r\n\r\n  [1]: https://cran.r-project.org/web/packages/RANN.L1/RANN.L1.pdf",
    "125469": "I have used weighted knn classification using the kknn package with some good success. It allows general Minkowski distance and various weighting kernals. A nice R package for this competition to experiment with.",
    "125800": "Thanks for the responses.\r\n\r\n@SK ... this was exactly what I needed.  Although it is  bare bones, it plugged into the functions I'd written for the FNN results.  Thanks!\r\n\r\n@Khurram - I wish I had discovered this earlier.  This looks like a very robust package, and will probably be my goto for KNN and R in the future.  There's a bit to look into here, and I probably won't get to it before contest end.  Thanks for sharing."
  },
  "source": "meta"
}