{
  "id": 21204,
  "title": "3 outputs",
  "url": "/competitions/facebook-v-predicting-check-ins/discussion/21204",
  "author_name": "",
  "post_date": "2016-05-25T07:10:40.207Z",
  "votes": null,
  "comment_count": 3,
  "views": 485,
  "content": "<p>I am not sure, which math model predicts more than one recommendation!!! How do we generate 3 priority outputs then ?</p>\n\n<p>Shall we run the model 3 times hoping that recommendations will be different each time (though that makes model less stable)?</p>",
  "messages": [
    {
      "id": "121256",
      "postDate": "05/25/2016 07:10:40",
      "content": "<p>I am not sure, which math model predicts more than one recommendation!!! How do we generate 3 priority outputs then ?</p>\n\n<p>Shall we run the model 3 times hoping that recommendations will be different each time (though that makes model less stable)?</p>",
      "rawMarkdown": "I am not sure, which math model predicts more than one recommendation!!! How do we generate 3 priority outputs then ?\r\n\r\nShall we run the model 3 times hoping that recommendations will be different each time (though that makes model less stable)?",
      "votes": null
    },
    {
      "id": "121258",
      "postDate": "05/25/2016 07:28:52",
      "content": "<p>Most classifiers are also capable of generating a vector with probability estimations (e.g. for scikit-learn you can use the function predict_proba).\nYou can sort them &amp; select the top 3 values. If you use Python, here is a way to do this: <a href=\"http://stackoverflow.com/questions/32461246/how-to-get-top-3-or-top-n-predictions-using-sklearns-sgdclassifier\">http://stackoverflow.com/questions/32461246/how-to-get-top-3-or-top-n-predictions-using-sklearns-sgdclassifier</a></p>",
      "rawMarkdown": "Most classifiers are also capable of generating a vector with probability estimations (e.g. for scikit-learn you can use the function predict_proba).\r\nYou can sort them & select the top 3 values. If you use Python, here is a way to do this: http://stackoverflow.com/questions/32461246/how-to-get-top-3-or-top-n-predictions-using-sklearns-sgdclassifier",
      "votes": null
    },
    {
      "id": "121266",
      "postDate": "05/25/2016 08:17:40",
      "content": "<p>Thanks Daniel for your help. Do we have something similar in R?</p>",
      "rawMarkdown": "Thanks Daniel for your help. Do we have something similar in R?",
      "votes": null
    },
    {
      "id": "121317",
      "postDate": "05/25/2016 15:35:50",
      "content": "<p>For R, look up the help documentation for the classifier you are using (more specifically, usually its predict method). Most likely, there will be some toggle such as &quot;probability=TRUE&quot; to have the model generate probabilities for you. An example for randomForest's predict function:</p>\n\n<p>&quot;type\none of response, prob. or votes, indicating the type of output: predicted values, matrix of class probabilities, or matrix of vote counts.&quot;</p>\n\n<p>so we can set it up by doing something like:</p>\n\n<p>predictions &lt;- predict(rf_model, test_data, type='prob')</p>",
      "rawMarkdown": "For R, look up the help documentation for the classifier you are using (more specifically, usually its predict method). Most likely, there will be some toggle such as \"probability=TRUE\" to have the model generate probabilities for you. An example for randomForest's predict function:\r\n\r\n\"type\r\none of response, prob. or votes, indicating the type of output: predicted values, matrix of class probabilities, or matrix of vote counts.\"\r\n\r\nso we can set it up by doing something like:\r\n\r\npredictions <- predict(rf_model, test_data, type='prob')",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 121258,
      "author_name": "danielheres",
      "author_url": "",
      "post_date": "05/25/2016 07:28:52",
      "content": "<p>Most classifiers are also capable of generating a vector with probability estimations (e.g. for scikit-learn you can use the function predict_proba).\nYou can sort them &amp; select the top 3 values. If you use Python, here is a way to do this: <a href=\"http://stackoverflow.com/questions/32461246/how-to-get-top-3-or-top-n-predictions-using-sklearns-sgdclassifier\">http://stackoverflow.com/questions/32461246/how-to-get-top-3-or-top-n-predictions-using-sklearns-sgdclassifier</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 121266,
      "author_name": "sandeepak",
      "author_url": "",
      "post_date": "05/25/2016 08:17:40",
      "content": "<p>Thanks Daniel for your help. Do we have something similar in R?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 121317,
      "author_name": "fireiceearth",
      "author_url": "",
      "post_date": "05/25/2016 15:35:50",
      "content": "<p>For R, look up the help documentation for the classifier you are using (more specifically, usually its predict method). Most likely, there will be some toggle such as &quot;probability=TRUE&quot; to have the model generate probabilities for you. An example for randomForest's predict function:</p>\n\n<p>&quot;type\none of response, prob. or votes, indicating the type of output: predicted values, matrix of class probabilities, or matrix of vote counts.&quot;</p>\n\n<p>so we can set it up by doing something like:</p>\n\n<p>predictions &lt;- predict(rf_model, test_data, type='prob')</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "121256": "I am not sure, which math model predicts more than one recommendation!!! How do we generate 3 priority outputs then ?\r\n\r\nShall we run the model 3 times hoping that recommendations will be different each time (though that makes model less stable)?",
    "121258": "Most classifiers are also capable of generating a vector with probability estimations (e.g. for scikit-learn you can use the function predict_proba).\r\nYou can sort them & select the top 3 values. If you use Python, here is a way to do this: http://stackoverflow.com/questions/32461246/how-to-get-top-3-or-top-n-predictions-using-sklearns-sgdclassifier",
    "121266": "Thanks Daniel for your help. Do we have something similar in R?",
    "121317": "For R, look up the help documentation for the classifier you are using (more specifically, usually its predict method). Most likely, there will be some toggle such as \"probability=TRUE\" to have the model generate probabilities for you. An example for randomForest's predict function:\r\n\r\n\"type\r\none of response, prob. or votes, indicating the type of output: predicted values, matrix of class probabilities, or matrix of vote counts.\"\r\n\r\nso we can set it up by doing something like:\r\n\r\npredictions <- predict(rf_model, test_data, type='prob')"
  },
  "source": "meta"
}