{
  "id": 120810,
  "title": "Why one model per building performs badly?",
  "url": "/competitions/ashrae-energy-prediction/discussion/120810",
  "author_name": "Fernando Wittmann",
  "post_date": "2019-12-09T02:20:10.930000",
  "votes": 5,
  "comment_count": 15,
  "views": 0,
  "content": "<p>When I joined this competition, my first hypothesis of a good predictor was to have one model per building. Theoretically, this seems to make sense since each building has a different behavior. However, when trying in practice, I got very bad LB scores (higher than 2). The score is worse than simply predicting the average per building (1.64). Did anyone else try as well? Any idea why it turns out to be a bad idea?</p>",
  "messages": [
    {
      "id": 690722,
      "postDate": "2019-12-09T02:20:10.930Z",
      "content": "<p>When I joined this competition, my first hypothesis of a good predictor was to have one model per building. Theoretically, this seems to make sense since each building has a different behavior. However, when trying in practice, I got very bad LB scores (higher than 2). The score is worse than simply predicting the average per building (1.64). Did anyone else try as well? Any idea why it turns out to be a bad idea?</p>",
      "rawMarkdown": "When I joined this competition, my first hypothesis of a good predictor was to have one model per building. Theoretically, this seems to make sense since each building has a different behavior. However, when trying in practice, I got very bad LB scores (higher than 2). The score is worse than simply predicting the average per building (1.64). Did anyone else try as well? Any idea why it turns out to be a bad idea?",
      "votes": 5
    },
    {
      "id": 693204,
      "postDate": "2019-12-12T06:17:24.510Z",
      "content": "<p>I've manage to score 1.07 (public LB) with per-building models. More precisely, and this might be part of your problem, I used per-building <em>and</em> per-meter (2380 models instead of 1449). I used GBDTs, and <em>did</em> use different hyperparameters than I would use for a single global model.</p>",
      "rawMarkdown": "I've manage to score 1.07 (public LB) with per-building models. More precisely, and this might be part of your problem, I used per-building *and* per-meter (2380 models instead of 1449). I used GBDTs, and *did* use different hyperparameters than I would use for a single global model.\n",
      "votes": 6,
      "replies": [
        {
          "id": 693683,
          "postDate": "2019-12-12T17:09:30.813Z",
          "content": "<p>Wow, congrats! That will bring some hope for me to keep trying. I also tried both per bldg and per meter models with no success. The problem seems to be overfitting.</p>",
          "rawMarkdown": "Wow, congrats! That will bring some hope for me to keep trying. I also tried both per bldg and per meter models with no success. The problem seems to be overfitting."
        }
      ]
    },
    {
      "id": 690871,
      "postDate": "2019-12-09T09:18:33.220Z",
      "content": "<p>You're doing something wrong. For me it works good.</p>",
      "rawMarkdown": "You're doing something wrong. For me it works good.",
      "votes": 3,
      "replies": [
        {
          "id": 692943,
          "postDate": "2019-12-11T21:40:05.570Z",
          "content": "<p>Thanks for the comment <a href=\"/oleg90777\">@oleg90777</a> ! Did you use NNs?</p>",
          "rawMarkdown": "Thanks for the comment @oleg90777 ! Did you use NNs?"
        },
        {
          "id": 693255,
          "postDate": "2019-12-12T07:27:47.043Z",
          "content": "<p>At the moment only lgb</p>",
          "rawMarkdown": "At the moment only lgb"
        }
      ]
    },
    {
      "id": 692437,
      "postDate": "2019-12-11T08:57:09.020Z",
      "content": "<p>If you are doing a linear model with a lot of features and no regularization, chances are you are overfitting a lot and may have very large coefficients which will result in crazy predictions on the test set. You should try plotting your predictions to get a feel of what is going on. They should at least bear some resemblance to the data from 2016.</p>",
      "rawMarkdown": "If you are doing a linear model with a lot of features and no regularization, chances are you are overfitting a lot and may have very large coefficients which will result in crazy predictions on the test set. You should try plotting your predictions to get a feel of what is going on. They should at least bear some resemblance to the data from 2016.",
      "votes": 1
    },
    {
      "id": 691143,
      "postDate": "2019-12-09T17:39:14.160Z",
      "content": "<p>Are you using the same model as you would use when training on all the data? Then the model may have some serious overfitting because you are training on less data. Adding more regularization will probably improve the score.</p>",
      "rawMarkdown": "Are you using the same model as you would use when training on all the data? Then the model may have some serious overfitting because you are training on less data. Adding more regularization will probably improve the score.",
      "votes": 1
    },
    {
      "id": 690858,
      "postDate": "2019-12-09T08:55:40.747Z",
      "content": "<p>the problem is that, a single building does not have enough of observations to gerenalize well! For example, there are buildings which don't have some of the observations for some intervals, however, these interval exist in the test set.</p>",
      "rawMarkdown": "the problem is that, a single building does not have enough of observations to gerenalize well! For example, there are buildings which don't have some of the observations for some intervals, however, these interval exist in the test set.",
      "votes": 1
    },
    {
      "id": 697756,
      "postDate": "2019-12-18T11:04:06.777Z",
      "content": "<p>Does sklearn allow train several models per type? And automatically apply them during prediction? Or I should manually create and evaluate each model?</p>",
      "rawMarkdown": "Does sklearn allow train several models per type? And automatically apply them during prediction? Or I should manually create and evaluate each model?"
    },
    {
      "id": 692937,
      "postDate": "2019-12-11T21:32:30.847Z",
      "content": "<p>Thanks for the comments guys! Good to know that there are some competitors having success on that road. My last failed attempt (quite frustrating because it took me some time) was to first create a generic NN trained on all buildings (LB of 1.12). Later, I used transfer learning to fine-tune the very same model for each building. But for some reason, the results are getting worse. Even when using higher dropout rates, model checkpoint and freezing the top layers.</p>",
      "rawMarkdown": "Thanks for the comments guys! Good to know that there are some competitors having success on that road. My last failed attempt (quite frustrating because it took me some time) was to first create a generic NN trained on all buildings (LB of 1.12). Later, I used transfer learning to fine-tune the very same model for each building. But for some reason, the results are getting worse. Even when using higher dropout rates, model checkpoint and freezing the top layers."
    },
    {
      "id": 695242,
      "postDate": "2019-12-14T20:35:15.783Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 691327,
      "postDate": "2019-12-10T01:59:09.910Z",
      "rawMarkdown": "",
      "isDeleted": true,
      "replies": [
        {
          "id": 692942,
          "postDate": "2019-12-11T21:38:32.583Z",
          "content": "<p>Thanks for the hint <a href=\"/davide0burba\">@davide0burba</a> ! If you don't mind answering, how did you extract Fourier terms from the training set? To my knowledge, that's only possible in signals (which is the target in your case). </p>",
          "rawMarkdown": "Thanks for the hint @davide0burba ! If you don't mind answering, how did you extract Fourier terms from the training set? To my knowledge, that's only possible in signals (which is the target in your case). "
        },
        {
          "id": 693104,
          "postDate": "2019-12-12T03:11:27.830Z",
          "rawMarkdown": "",
          "votes": 2,
          "isDeleted": true
        }
      ]
    },
    {
      "id": 690740,
      "postDate": "2019-12-09T03:12:07.580Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 693204,
      "author_name": "Robert Stockton",
      "author_url": "",
      "post_date": "2019-12-12T06:17:24.510000",
      "content": "<p>I've manage to score 1.07 (public LB) with per-building models. More precisely, and this might be part of your problem, I used per-building <em>and</em> per-meter (2380 models instead of 1449). I used GBDTs, and <em>did</em> use different hyperparameters than I would use for a single global model.</p>",
      "votes": 6,
      "replies": [
        {
          "id": 693683,
          "author_name": "Fernando Wittmann",
          "author_url": "",
          "post_date": "2019-12-12T17:09:30.813000",
          "content": "<p>Wow, congrats! That will bring some hope for me to keep trying. I also tried both per bldg and per meter models with no success. The problem seems to be overfitting.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 690871,
      "author_name": "Oleg Knaub",
      "author_url": "",
      "post_date": "2019-12-09T09:18:33.220000",
      "content": "<p>You're doing something wrong. For me it works good.</p>",
      "votes": 3,
      "replies": [
        {
          "id": 692943,
          "author_name": "Fernando Wittmann",
          "author_url": "",
          "post_date": "2019-12-11T21:40:05.570000",
          "content": "<p>Thanks for the comment <a href=\"/oleg90777\">@oleg90777</a> ! Did you use NNs?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 693255,
          "author_name": "Oleg Knaub",
          "author_url": "",
          "post_date": "2019-12-12T07:27:47.043000",
          "content": "<p>At the moment only lgb</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 692437,
      "author_name": "Larry D.",
      "author_url": "",
      "post_date": "2019-12-11T08:57:09.020000",
      "content": "<p>If you are doing a linear model with a lot of features and no regularization, chances are you are overfitting a lot and may have very large coefficients which will result in crazy predictions on the test set. You should try plotting your predictions to get a feel of what is going on. They should at least bear some resemblance to the data from 2016.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 691143,
      "author_name": "Carlo",
      "author_url": "",
      "post_date": "2019-12-09T17:39:14.160000",
      "content": "<p>Are you using the same model as you would use when training on all the data? Then the model may have some serious overfitting because you are training on less data. Adding more regularization will probably improve the score.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 690858,
      "author_name": "BearInMind",
      "author_url": "",
      "post_date": "2019-12-09T08:55:40.747000",
      "content": "<p>the problem is that, a single building does not have enough of observations to gerenalize well! For example, there are buildings which don't have some of the observations for some intervals, however, these interval exist in the test set.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 697756,
      "author_name": "Nazar",
      "author_url": "",
      "post_date": "2019-12-18T11:04:06.777000",
      "content": "<p>Does sklearn allow train several models per type? And automatically apply them during prediction? Or I should manually create and evaluate each model?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 692937,
      "author_name": "Fernando Wittmann",
      "author_url": "",
      "post_date": "2019-12-11T21:32:30.847000",
      "content": "<p>Thanks for the comments guys! Good to know that there are some competitors having success on that road. My last failed attempt (quite frustrating because it took me some time) was to first create a generic NN trained on all buildings (LB of 1.12). Later, I used transfer learning to fine-tune the very same model for each building. But for some reason, the results are getting worse. Even when using higher dropout rates, model checkpoint and freezing the top layers.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 695242,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-12-14T20:35:15.783000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 691327,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-12-10T01:59:09.910000",
      "content": "",
      "votes": 0,
      "replies": [
        {
          "id": 692942,
          "author_name": "Fernando Wittmann",
          "author_url": "",
          "post_date": "2019-12-11T21:38:32.583000",
          "content": "<p>Thanks for the hint <a href=\"/davide0burba\">@davide0burba</a> ! If you don't mind answering, how did you extract Fourier terms from the training set? To my knowledge, that's only possible in signals (which is the target in your case). </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 693104,
          "author_name": "",
          "author_url": "",
          "post_date": "2019-12-12T03:11:27.830000",
          "content": "",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 690740,
      "author_name": "",
      "author_url": "",
      "post_date": "2019-12-09T03:12:07.580000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "690722": "When I joined this competition, my first hypothesis of a good predictor was to have one model per building. Theoretically, this seems to make sense since each building has a different behavior. However, when trying in practice, I got very bad LB scores (higher than 2). The score is worse than simply predicting the average per building (1.64). Did anyone else try as well? Any idea why it turns out to be a bad idea?",
    "693204": "I've manage to score 1.07 (public LB) with per-building models. More precisely, and this might be part of your problem, I used per-building *and* per-meter (2380 models instead of 1449). I used GBDTs, and *did* use different hyperparameters than I would use for a single global model.\n",
    "690871": "You're doing something wrong. For me it works good.",
    "692437": "If you are doing a linear model with a lot of features and no regularization, chances are you are overfitting a lot and may have very large coefficients which will result in crazy predictions on the test set. You should try plotting your predictions to get a feel of what is going on. They should at least bear some resemblance to the data from 2016.",
    "691143": "Are you using the same model as you would use when training on all the data? Then the model may have some serious overfitting because you are training on less data. Adding more regularization will probably improve the score.",
    "690858": "the problem is that, a single building does not have enough of observations to gerenalize well! For example, there are buildings which don't have some of the observations for some intervals, however, these interval exist in the test set.",
    "697756": "Does sklearn allow train several models per type? And automatically apply them during prediction? Or I should manually create and evaluate each model?",
    "692937": "Thanks for the comments guys! Good to know that there are some competitors having success on that road. My last failed attempt (quite frustrating because it took me some time) was to first create a generic NN trained on all buildings (LB of 1.12). Later, I used transfer learning to fine-tune the very same model for each building. But for some reason, the results are getting worse. Even when using higher dropout rates, model checkpoint and freezing the top layers.",
    "695242": "",
    "691327": "",
    "690740": ""
  }
}