{
  "id": 339205,
  "title": "How to do a ranking ensemble?",
  "url": "/competitions/amex-default-prediction/discussion/339205",
  "author_name": "",
  "post_date": "2022-07-23T19:11:51.316226900Z",
  "votes": 1,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I have a several XGBoosts that return probabilities for all samples. How do I blend ranks? Do I just average ranks among all predictions? But what if several samples have same average ranks? For example, (2, 5) and (3, 4), this will assign 3.5 to both samples.</p>",
  "messages": [
    {
      "id": "1868177",
      "postDate": "07/23/2022 19:11:51",
      "content": "<p>I have a several XGBoosts that return probabilities for all samples. How do I blend ranks? Do I just average ranks among all predictions? But what if several samples have same average ranks? For example, (2, 5) and (3, 4), this will assign 3.5 to both samples.</p>",
      "rawMarkdown": "I have a several XGBoosts that return probabilities for all samples. How do I blend ranks? Do I just average ranks among all predictions? But what if several samples have same average ranks? For example, (2, 5) and (3, 4), this will assign 3.5 to both samples.",
      "votes": null
    },
    {
      "id": "1868214",
      "postDate": "07/23/2022 19:47:04",
      "content": "<p>There are many ways to blend predictions. Let's assume we have <code>preds_1</code> and <code>preds_2</code>. Below are three common examples:</p>\n<ul>\n<li>arithmetic mean: <code>w*preds_1 + (1-w)*preds2</code></li>\n<li>geometric mean: <code>preds_1**w * preds_2**(1-w)</code></li>\n<li>rank mean: <code>w*scipy.stats.rankdata(preds_1) + (1-w)*scipy.stats.rankdata(preds_2)</code></li>\n</ul>",
      "rawMarkdown": "There are many ways to blend predictions. Let's assume we have `preds_1` and `preds_2`. Below are three common examples:\n* arithmetic mean: `w*preds_1 + (1-w)*preds2`\n* geometric mean: `preds_1**w * preds_2**(1-w)`\n* rank mean: `w*scipy.stats.rankdata(preds_1) + (1-w)*scipy.stats.rankdata(preds_2)`",
      "votes": null
    },
    {
      "id": "1868335",
      "postDate": "07/23/2022 23:14:38",
      "content": "<p>I just posted a short script <a href=\"https://www.kaggle.com/competitions/amex-default-prediction/discussion/339238\" target=\"_blank\"><strong>here</strong></a> that may be helpful.</p>",
      "rawMarkdown": "I just posted a short script [**here**](https://www.kaggle.com/competitions/amex-default-prediction/discussion/339238) that may be helpful.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1868214,
      "author_name": "cdeotte",
      "author_url": "",
      "post_date": "07/23/2022 19:47:04",
      "content": "<p>There are many ways to blend predictions. Let's assume we have <code>preds_1</code> and <code>preds_2</code>. Below are three common examples:</p>\n<ul>\n<li>arithmetic mean: <code>w*preds_1 + (1-w)*preds2</code></li>\n<li>geometric mean: <code>preds_1**w * preds_2**(1-w)</code></li>\n<li>rank mean: <code>w*scipy.stats.rankdata(preds_1) + (1-w)*scipy.stats.rankdata(preds_2)</code></li>\n</ul>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1868335,
      "author_name": "tilii7",
      "author_url": "",
      "post_date": "07/23/2022 23:14:38",
      "content": "<p>I just posted a short script <a href=\"https://www.kaggle.com/competitions/amex-default-prediction/discussion/339238\" target=\"_blank\"><strong>here</strong></a> that may be helpful.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1868177": "I have a several XGBoosts that return probabilities for all samples. How do I blend ranks? Do I just average ranks among all predictions? But what if several samples have same average ranks? For example, (2, 5) and (3, 4), this will assign 3.5 to both samples.",
    "1868214": "There are many ways to blend predictions. Let's assume we have `preds_1` and `preds_2`. Below are three common examples:\n* arithmetic mean: `w*preds_1 + (1-w)*preds2`\n* geometric mean: `preds_1**w * preds_2**(1-w)`\n* rank mean: `w*scipy.stats.rankdata(preds_1) + (1-w)*scipy.stats.rankdata(preds_2)`",
    "1868335": "I just posted a short script [**here**](https://www.kaggle.com/competitions/amex-default-prediction/discussion/339238) that may be helpful."
  },
  "source": "meta"
}