{
  "id": 94371,
  "title": "Post-mortem code ?",
  "url": "/competitions/dota-2-prediction/discussion/94371",
  "author_name": "",
  "post_date": "2019-06-04T06:30:07.505921400Z",
  "votes": 7,
  "comment_count": 5,
  "views": 0,
  "content": "<p>I hope everyone had fun scatching their heads on this competition. Since the competition is over i would to have everyone's opinion on strategies, tools  and peprocessing/ features engineering.</p>",
  "messages": [
    {
      "id": "542846",
      "postDate": "06/04/2019 06:30:07",
      "content": "<p>I hope everyone had fun scatching their heads on this competition. Since the competition is over i would to have everyone's opinion on strategies, tools  and peprocessing/ features engineering.</p>",
      "rawMarkdown": "I hope everyone had fun scatching their heads on this competition. Since the competition is over i would to have everyone's opinion on strategies, tools  and peprocessing/ features engineering.",
      "votes": null
    },
    {
      "id": "543263",
      "postDate": "06/04/2019 12:23:34",
      "content": "<p>Hello Azer,\nA brief description of our strategy: \n- Players sorted by xp (could be improved): the goal was to give a meaning to player stats (kills, deaths, golds,...) according to their roles (carry, support, ...)\n- Calculation of the win rate for each hero + mean and std per team\n- Calculation of the win rate for each duo pair + mean per team\n- Global stats per team (gold average, kill average, ...)\n- 110 predictive models trained on each hero stats at 5 mins + the win rate of the hero: the goal was to get the ability of each player to win the game according to the selected hero and his stats at 5mins. Average of the probabilities returned by the models for each team\n- A score to evaluate the better hero composition calculated by another model (based on a sparse matrix of hero played for each game)</p>\n\n<ul>\n<li>We use a Lightgbm with 5 folds</li>\n<li>To avoid data leakage we only calculated Win rate on the training set and not on the valid set</li>\n</ul>",
      "rawMarkdown": "Hello Azer,\nA brief description of our strategy: \n- Players sorted by xp (could be improved): the goal was to give a meaning to player stats (kills, deaths, golds,...) according to their roles (carry, support, ...)\n- Calculation of the win rate for each hero + mean and std per team\n- Calculation of the win rate for each duo pair + mean per team\n- Global stats per team (gold average, kill average, ...)\n- 110 predictive models trained on each hero stats at 5 mins + the win rate of the hero: the goal was to get the ability of each player to win the game according to the selected hero and his stats at 5mins. Average of the probabilities returned by the models for each team\n- A score to evaluate the better hero composition calculated by another model (based on a sparse matrix of hero played for each game)\n\n- We use a Lightgbm with 5 folds\n- To avoid data leakage we only calculated Win rate on the training set and not on the valid set",
      "votes": null
    },
    {
      "id": "544401",
      "postDate": "06/05/2019 13:20:27",
      "content": "<p>I'm mostly scratching my head about the ~0.8 AUC. </p>\n\n<p>My submission focused on team-level feature engineering particularly related to gold, xp and hero win rates. For modeling I used xgboost, lightgbm and logistic regression.</p>",
      "rawMarkdown": "I'm mostly scratching my head about the ~0.8 AUC. \n\nMy submission focused on team-level feature engineering particularly related to gold, xp and hero win rates. For modeling I used xgboost, lightgbm and logistic regression.",
      "votes": null
    },
    {
      "id": "544760",
      "postDate": "06/05/2019 22:06:24",
      "content": "<p>Relatively offtopic - I think the levels from the dataset are bugged 😄 ! The average level is ~1.2 which is way too low for 5 minutes of gameplay and not coherent with the XP values. Here's short script to fix this (even though I doubt it makes any difference in terms of final performance):\n<code>\ndef fix_levels(df):\n    total_exp_for_level = [0, 230, 600, 1080, 1660, 2260, 2980, 3730, 4510]\n    level = np.zeros(5000, dtype=int)\n    for exp in total_exp_for_level:\n        level[exp :] += 1\n    for team_name in ['r', 'd']:\n        for player_idx in range(1, 6):\n            xp = df['%s%d_xp' % (team_name, player_idx)].to_numpy()\n            fixed_level = level[xp]\n            df['%s%d_level' % (team_name, player_idx)] = fixed_level\n</code></p>",
      "rawMarkdown": "Relatively offtopic - I think the levels from the dataset are bugged 😄 ! The average level is ~1.2 which is way too low for 5 minutes of gameplay and not coherent with the XP values. Here's short script to fix this (even though I doubt it makes any difference in terms of final performance):\n```\ndef fix_levels(df):\n    total_exp_for_level = [0, 230, 600, 1080, 1660, 2260, 2980, 3730, 4510]\n    level = np.zeros(5000, dtype=int)\n    for exp in total_exp_for_level:\n        level[exp :] += 1\n    for team_name in ['r', 'd']:\n        for player_idx in range(1, 6):\n            xp = df['%s%d_xp' % (team_name, player_idx)].to_numpy()\n            fixed_level = level[xp]\n            df['%s%d_level' % (team_name, player_idx)] = fixed_level\n```",
      "votes": null
    },
    {
      "id": "544780",
      "postDate": "06/05/2019 23:01:58",
      "content": "<p>For what it's worth: Unless you are mining the Dota2 .dem files directly with a parser (e.g. Clarity or similar) there are only a couple of relatively easy methods available for you to tell what level a certain hero was at a certain point in time. One of them is to calculate level based on the total EXP collected, but that won't give you the full picture (or rather, it is not as important as the other method). Instead of giving you redundant info (total EXP and Levels are kind of the same) we've counted the number of ability points spent up until the first 5 minutes. This may or may not skew the data, but the dataset itself had all kinds of (other) problems. We wanted to give a dataset where your knowledge, passion and creativity could give you an edge over other competitors. \"Fixing\" the levels (although it probably won't help much since you're distilling the info contained in the collected EXP feature to a different, equivalent feature) like you is definitely one of these creative steps that we were very happy to see in some applicants'/contestants' work, so props to you. </p>\n\n<p>A couple of other things to think about:\n- How many of you have noticed the negative buy times for certain items? Could you figure out what they mean?\n- How come that in quite a large number of games we had 0 xp, 0 levels for all heroes in the match but we still indicated the outcome of the match? What did you do with those matches?</p>",
      "rawMarkdown": "For what it's worth: Unless you are mining the Dota2 .dem files directly with a parser (e.g. Clarity or similar) there are only a couple of relatively easy methods available for you to tell what level a certain hero was at a certain point in time. One of them is to calculate level based on the total EXP collected, but that won't give you the full picture (or rather, it is not as important as the other method). Instead of giving you redundant info (total EXP and Levels are kind of the same) we've counted the number of ability points spent up until the first 5 minutes. This may or may not skew the data, but the dataset itself had all kinds of (other) problems. We wanted to give a dataset where your knowledge, passion and creativity could give you an edge over other competitors. \"Fixing\" the levels (although it probably won't help much since you're distilling the info contained in the collected EXP feature to a different, equivalent feature) like you is definitely one of these creative steps that we were very happy to see in some applicants'/contestants' work, so props to you. \n\nA couple of other things to think about:\n- How many of you have noticed the negative buy times for certain items? Could you figure out what they mean?\n- How come that in quite a large number of games we had 0 xp, 0 levels for all heroes in the match but we still indicated the outcome of the match? What did you do with those matches?",
      "votes": null
    },
    {
      "id": "550091",
      "postDate": "06/11/2019 09:45:25",
      "content": "<p>Hi everyone,\nHere you can find the main parts of my solution : \n- Get dummies and added features  on hero characteristics (agi, str, int) and roles(carry, disabler...)\n- Added ratio gold and xp for each team compared to the average of a game\n- Rescale all not bolean features with PowerTransformer\n- Replace missing values with a value higher than the max of the column (the event has not taken place yet but he will arrive later)\n- Tune and stack an ExtraTrees, an GradientBoosting and a small Keras NeuralNetwork</p>",
      "rawMarkdown": "Hi everyone,\nHere you can find the main parts of my solution : \n- Get dummies and added features  on hero characteristics (agi, str, int) and roles(carry, disabler...)\n- Added ratio gold and xp for each team compared to the average of a game\n- Rescale all not bolean features with PowerTransformer\n- Replace missing values with a value higher than the max of the column (the event has not taken place yet but he will arrive later)\n- Tune and stack an ExtraTrees, an GradientBoosting and a small Keras NeuralNetwork",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 543263,
      "author_name": "m1llenium",
      "author_url": "",
      "post_date": "06/04/2019 12:23:34",
      "content": "<p>Hello Azer,\nA brief description of our strategy: \n- Players sorted by xp (could be improved): the goal was to give a meaning to player stats (kills, deaths, golds,...) according to their roles (carry, support, ...)\n- Calculation of the win rate for each hero + mean and std per team\n- Calculation of the win rate for each duo pair + mean per team\n- Global stats per team (gold average, kill average, ...)\n- 110 predictive models trained on each hero stats at 5 mins + the win rate of the hero: the goal was to get the ability of each player to win the game according to the selected hero and his stats at 5mins. Average of the probabilities returned by the models for each team\n- A score to evaluate the better hero composition calculated by another model (based on a sparse matrix of hero played for each game)</p>\n\n<ul>\n<li>We use a Lightgbm with 5 folds</li>\n<li>To avoid data leakage we only calculated Win rate on the training set and not on the valid set</li>\n</ul>",
      "votes": null,
      "replies": []
    },
    {
      "id": 544401,
      "author_name": "hamelg",
      "author_url": "",
      "post_date": "06/05/2019 13:20:27",
      "content": "<p>I'm mostly scratching my head about the ~0.8 AUC. </p>\n\n<p>My submission focused on team-level feature engineering particularly related to gold, xp and hero win rates. For modeling I used xgboost, lightgbm and logistic regression.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 544760,
      "author_name": "mihaidusmanu",
      "author_url": "",
      "post_date": "06/05/2019 22:06:24",
      "content": "<p>Relatively offtopic - I think the levels from the dataset are bugged 😄 ! The average level is ~1.2 which is way too low for 5 minutes of gameplay and not coherent with the XP values. Here's short script to fix this (even though I doubt it makes any difference in terms of final performance):\n<code>\ndef fix_levels(df):\n    total_exp_for_level = [0, 230, 600, 1080, 1660, 2260, 2980, 3730, 4510]\n    level = np.zeros(5000, dtype=int)\n    for exp in total_exp_for_level:\n        level[exp :] += 1\n    for team_name in ['r', 'd']:\n        for player_idx in range(1, 6):\n            xp = df['%s%d_xp' % (team_name, player_idx)].to_numpy()\n            fixed_level = level[xp]\n            df['%s%d_level' % (team_name, player_idx)] = fixed_level\n</code></p>",
      "votes": null,
      "replies": [
        {
          "id": 544780,
          "author_name": "vidosits",
          "author_url": "",
          "post_date": "06/05/2019 23:01:58",
          "content": "<p>For what it's worth: Unless you are mining the Dota2 .dem files directly with a parser (e.g. Clarity or similar) there are only a couple of relatively easy methods available for you to tell what level a certain hero was at a certain point in time. One of them is to calculate level based on the total EXP collected, but that won't give you the full picture (or rather, it is not as important as the other method). Instead of giving you redundant info (total EXP and Levels are kind of the same) we've counted the number of ability points spent up until the first 5 minutes. This may or may not skew the data, but the dataset itself had all kinds of (other) problems. We wanted to give a dataset where your knowledge, passion and creativity could give you an edge over other competitors. \"Fixing\" the levels (although it probably won't help much since you're distilling the info contained in the collected EXP feature to a different, equivalent feature) like you is definitely one of these creative steps that we were very happy to see in some applicants'/contestants' work, so props to you. </p>\n\n<p>A couple of other things to think about:\n- How many of you have noticed the negative buy times for certain items? Could you figure out what they mean?\n- How come that in quite a large number of games we had 0 xp, 0 levels for all heroes in the match but we still indicated the outcome of the match? What did you do with those matches?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 550091,
      "author_name": "gwendallb",
      "author_url": "",
      "post_date": "06/11/2019 09:45:25",
      "content": "<p>Hi everyone,\nHere you can find the main parts of my solution : \n- Get dummies and added features  on hero characteristics (agi, str, int) and roles(carry, disabler...)\n- Added ratio gold and xp for each team compared to the average of a game\n- Rescale all not bolean features with PowerTransformer\n- Replace missing values with a value higher than the max of the column (the event has not taken place yet but he will arrive later)\n- Tune and stack an ExtraTrees, an GradientBoosting and a small Keras NeuralNetwork</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "542846": "I hope everyone had fun scatching their heads on this competition. Since the competition is over i would to have everyone's opinion on strategies, tools  and peprocessing/ features engineering.",
    "543263": "Hello Azer,\nA brief description of our strategy: \n- Players sorted by xp (could be improved): the goal was to give a meaning to player stats (kills, deaths, golds,...) according to their roles (carry, support, ...)\n- Calculation of the win rate for each hero + mean and std per team\n- Calculation of the win rate for each duo pair + mean per team\n- Global stats per team (gold average, kill average, ...)\n- 110 predictive models trained on each hero stats at 5 mins + the win rate of the hero: the goal was to get the ability of each player to win the game according to the selected hero and his stats at 5mins. Average of the probabilities returned by the models for each team\n- A score to evaluate the better hero composition calculated by another model (based on a sparse matrix of hero played for each game)\n\n- We use a Lightgbm with 5 folds\n- To avoid data leakage we only calculated Win rate on the training set and not on the valid set",
    "544401": "I'm mostly scratching my head about the ~0.8 AUC. \n\nMy submission focused on team-level feature engineering particularly related to gold, xp and hero win rates. For modeling I used xgboost, lightgbm and logistic regression.",
    "544760": "Relatively offtopic - I think the levels from the dataset are bugged 😄 ! The average level is ~1.2 which is way too low for 5 minutes of gameplay and not coherent with the XP values. Here's short script to fix this (even though I doubt it makes any difference in terms of final performance):\n```\ndef fix_levels(df):\n    total_exp_for_level = [0, 230, 600, 1080, 1660, 2260, 2980, 3730, 4510]\n    level = np.zeros(5000, dtype=int)\n    for exp in total_exp_for_level:\n        level[exp :] += 1\n    for team_name in ['r', 'd']:\n        for player_idx in range(1, 6):\n            xp = df['%s%d_xp' % (team_name, player_idx)].to_numpy()\n            fixed_level = level[xp]\n            df['%s%d_level' % (team_name, player_idx)] = fixed_level\n```",
    "544780": "For what it's worth: Unless you are mining the Dota2 .dem files directly with a parser (e.g. Clarity or similar) there are only a couple of relatively easy methods available for you to tell what level a certain hero was at a certain point in time. One of them is to calculate level based on the total EXP collected, but that won't give you the full picture (or rather, it is not as important as the other method). Instead of giving you redundant info (total EXP and Levels are kind of the same) we've counted the number of ability points spent up until the first 5 minutes. This may or may not skew the data, but the dataset itself had all kinds of (other) problems. We wanted to give a dataset where your knowledge, passion and creativity could give you an edge over other competitors. \"Fixing\" the levels (although it probably won't help much since you're distilling the info contained in the collected EXP feature to a different, equivalent feature) like you is definitely one of these creative steps that we were very happy to see in some applicants'/contestants' work, so props to you. \n\nA couple of other things to think about:\n- How many of you have noticed the negative buy times for certain items? Could you figure out what they mean?\n- How come that in quite a large number of games we had 0 xp, 0 levels for all heroes in the match but we still indicated the outcome of the match? What did you do with those matches?",
    "550091": "Hi everyone,\nHere you can find the main parts of my solution : \n- Get dummies and added features  on hero characteristics (agi, str, int) and roles(carry, disabler...)\n- Added ratio gold and xp for each team compared to the average of a game\n- Rescale all not bolean features with PowerTransformer\n- Replace missing values with a value higher than the max of the column (the event has not taken place yet but he will arrive later)\n- Tune and stack an ExtraTrees, an GradientBoosting and a small Keras NeuralNetwork"
  },
  "source": "meta"
}