{
  "id": 113871,
  "title": "Improve score by 0.03",
  "url": "/competitions/ashrae-energy-prediction/discussion/113871",
  "author_name": "Manraj Singh",
  "post_date": "2019-10-22T17:15:38.814000",
  "votes": 14,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Till now I didn't find any kernel or maybe I missed, but none had these though this is a very basic thing.\nFrequency encoding the building_id increases the LB score by 0.03\nModel - LGBM, esti = 4000</p>\n\n<p><code>def mergetraintest(col):\n    a = pd.DataFrame(train[col],columns = [col])\n    b = pd.DataFrame(test[col],columns = [col])\n    case = a.append(b)\n    return case</code></p>\n\n<p><code>case = mergetraintest('building_id')\nbidencoding = case.groupby('building_id').size()\nbidencoding = bidencoding/len(case)\ntrain['building_id_freq'] = train.building_id.map(bidencoding)</code></p>\n\n<p>You can use my above code.\nI know the code is crap and can be optimized but it works. You can change the data type to float16\nDo upvote the kernel if you find this useful. Much appreciated! </p>",
  "messages": [
    {
      "id": 655087,
      "postDate": "2019-10-22T17:15:38.813Z",
      "content": "<p>Till now I didn't find any kernel or maybe I missed, but none had these though this is a very basic thing.\nFrequency encoding the building_id increases the LB score by 0.03\nModel - LGBM, esti = 4000</p>\n\n<p><code>def mergetraintest(col):\n    a = pd.DataFrame(train[col],columns = [col])\n    b = pd.DataFrame(test[col],columns = [col])\n    case = a.append(b)\n    return case</code></p>\n\n<p><code>case = mergetraintest('building_id')\nbidencoding = case.groupby('building_id').size()\nbidencoding = bidencoding/len(case)\ntrain['building_id_freq'] = train.building_id.map(bidencoding)</code></p>\n\n<p>You can use my above code.\nI know the code is crap and can be optimized but it works. You can change the data type to float16\nDo upvote the kernel if you find this useful. Much appreciated! </p>",
      "rawMarkdown": "Till now I didn't find any kernel or maybe I missed, but none had these though this is a very basic thing.\nFrequency encoding the building_id increases the LB score by 0.03\nModel - LGBM, esti = 4000\n\n`def mergetraintest(col):\n    a = pd.DataFrame(train[col],columns = [col])\n    b = pd.DataFrame(test[col],columns = [col])\n    case = a.append(b)\n    return case`\n\n`case = mergetraintest('building_id')\nbidencoding = case.groupby('building_id').size()\nbidencoding = bidencoding/len(case)\ntrain['building_id_freq'] = train.building_id.map(bidencoding)`\n\nYou can use my above code.\nI know the code is crap and can be optimized but it works. You can change the data type to float16\nDo upvote the kernel if you find this useful. Much appreciated! ",
      "votes": 14
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "655087": "Till now I didn't find any kernel or maybe I missed, but none had these though this is a very basic thing.\nFrequency encoding the building_id increases the LB score by 0.03\nModel - LGBM, esti = 4000\n\n`def mergetraintest(col):\n    a = pd.DataFrame(train[col],columns = [col])\n    b = pd.DataFrame(test[col],columns = [col])\n    case = a.append(b)\n    return case`\n\n`case = mergetraintest('building_id')\nbidencoding = case.groupby('building_id').size()\nbidencoding = bidencoding/len(case)\ntrain['building_id_freq'] = train.building_id.map(bidencoding)`\n\nYou can use my above code.\nI know the code is crap and can be optimized but it works. You can change the data type to float16\nDo upvote the kernel if you find this useful. Much appreciated! "
  }
}