{
  "id": 15907,
  "title": "Downsampling and aliasing",
  "url": "/competitions/grasp-and-lift-eeg-detection/discussion/15907",
  "author_name": "",
  "post_date": "2015-08-12T14:29:20.273Z",
  "votes": 2,
  "comment_count": 6,
  "views": 1228,
  "content": "<p>Hi, \nin most of the recent high score scripts is implemented a downsampling of the data, without a  low-pass filtering. Does this not introduce aliasing in the data? \nAre the result correct if we do downsampling in this way?</p>",
  "messages": [
    {
      "id": "89186",
      "postDate": "08/12/2015 14:29:20",
      "content": "<p>Hi, \nin most of the recent high score scripts is implemented a downsampling of the data, without a  low-pass filtering. Does this not introduce aliasing in the data? \nAre the result correct if we do downsampling in this way?</p>",
      "rawMarkdown": "Hi, \r\nin most of the recent high score scripts is implemented a downsampling of the data, without a  low-pass filtering. Does this not introduce aliasing in the data? \r\nAre the result correct if we do downsampling in this way?",
      "votes": null
    },
    {
      "id": "89249",
      "postDate": "08/13/2015 00:28:46",
      "content": "<p>The answer to your first question is yes.  As for the second question, that seems more complicated.  My take is that features based on aliased data are still features, so if they work for predicting things, then they work. On the other hand, they probably aren't quite the feature that one thinks they are, which will make the model difficult to interpret. Also the high frequencies are likely full of noise, which won't be great for the model accuracy to the extent that it leaks in through aliasing.</p>\n\n<p>I'm guilty of ripping out the low pass filtering in my script when I posted it, since I could barely get it to meet timing before they upped the limit. So, I was trimming whatever I could. I should at least have left a comment in about how one should probably add filtering though. I'll go do that now.</p>",
      "rawMarkdown": "The answer to your first question is yes.  As for the second question, that seems more complicated.  My take is that features based on aliased data are still features, so if they work for predicting things, then they work. On the other hand, they probably aren't quite the feature that one thinks they are, which will make the model difficult to interpret. Also the high frequencies are likely full of noise, which won't be great for the model accuracy to the extent that it leaks in through aliasing.\r\n\r\nI'm guilty of ripping out the low pass filtering in my script when I posted it, since I could barely get it to meet timing before they upped the limit. So, I was trimming whatever I could. I should at least have left a comment in about how one should probably add filtering though. I'll go do that now.",
      "votes": null
    },
    {
      "id": "89275",
      "postDate": "08/13/2015 05:47:48",
      "content": "<p>Thanks Tim. The point you wrote in the second part is important. Ok we can add any features to have better results, but is the model predicting what we want?\nThanks also for your good code. I learned a lot from it.</p>",
      "rawMarkdown": "Thanks Tim. The point you wrote in the second part is important. Ok we can add any features to have better results, but is the model predicting what we want?\r\nThanks also for your good code. I learned a lot from it.",
      "votes": null
    },
    {
      "id": "89420",
      "postDate": "08/15/2015 04:23:22",
      "content": "<p>You're welcome; I'm glad that code was helpful.</p>\n\n<p>And congrats on getting script of the week; that's great!</p>",
      "rawMarkdown": "You're welcome; I'm glad that code was helpful.\r\n\r\nAnd congrats on getting script of the week; that's great!",
      "votes": null
    },
    {
      "id": "89442",
      "postDate": "08/15/2015 15:11:00",
      "content": "<p>Tim, one more question. Did you get same good results for LB score, if apply the correct procedure for resampling the signal? \nI'm still wondering how this can affect the score. You are training on a downsampled signal (that means, aliasing or not, you are looking ad different frequency from the orginal one), but then you predict on a signal which is not resampled...</p>",
      "rawMarkdown": "Tim, one more question. Did you get same good results for LB score, if apply the correct procedure for resampling the signal? \r\nI'm still wondering how this can affect the score. You are training on a downsampled signal (that means, aliasing or not, you are looking ad different frequency from the orginal one), but then you predict on a signal which is not resampled...",
      "votes": null
    },
    {
      "id": "89446",
      "postDate": "08/15/2015 16:25:36",
      "content": "<p>Elena, I'm sorry, but I don't actually know how filtering or not affects things. All of my submission from home have been filtered before submitting. I have done some submissions from Kaggle scripts without filtering, but they have been smaller nets and not really comparable.  As for you second question, I train and predict on a resampled signal so it shouldn't be a problem (or at least not any more of an issue than downsampling in general). That is, when both training and testing, I use every nth point, starting with the most recent and going backwards in time.  I also filter both the test and training data in the same way, using a causal filter so I don't run afoul of the rule against future data.  This introduces a small lag from the filter, but that can't be helped.</p>",
      "rawMarkdown": "Elena, I'm sorry, but I don't actually know how filtering or not affects things. All of my submission from home have been filtered before submitting. I have done some submissions from Kaggle scripts without filtering, but they have been smaller nets and not really comparable.  As for you second question, I train and predict on a resampled signal so it shouldn't be a problem (or at least not any more of an issue than downsampling in general). That is, when both training and testing, I use every nth point, starting with the most recent and going backwards in time.  I also filter both the test and training data in the same way, using a causal filter so I don't run afoul of the rule against future data.  This introduces a small lag from the filter, but that can't be helped.",
      "votes": null
    },
    {
      "id": "89448",
      "postDate": "08/15/2015 16:37:27",
      "content": "<p>Thanks Tim for your explanation!</p>",
      "rawMarkdown": "Thanks Tim for your explanation!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 89249,
      "author_name": "bitsofbits",
      "author_url": "",
      "post_date": "08/13/2015 00:28:46",
      "content": "<p>The answer to your first question is yes.  As for the second question, that seems more complicated.  My take is that features based on aliased data are still features, so if they work for predicting things, then they work. On the other hand, they probably aren't quite the feature that one thinks they are, which will make the model difficult to interpret. Also the high frequencies are likely full of noise, which won't be great for the model accuracy to the extent that it leaks in through aliasing.</p>\n\n<p>I'm guilty of ripping out the low pass filtering in my script when I posted it, since I could barely get it to meet timing before they upped the limit. So, I was trimming whatever I could. I should at least have left a comment in about how one should probably add filtering though. I'll go do that now.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 89275,
      "author_name": "elenacuoco",
      "author_url": "",
      "post_date": "08/13/2015 05:47:48",
      "content": "<p>Thanks Tim. The point you wrote in the second part is important. Ok we can add any features to have better results, but is the model predicting what we want?\nThanks also for your good code. I learned a lot from it.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 89420,
      "author_name": "bitsofbits",
      "author_url": "",
      "post_date": "08/15/2015 04:23:22",
      "content": "<p>You're welcome; I'm glad that code was helpful.</p>\n\n<p>And congrats on getting script of the week; that's great!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 89442,
      "author_name": "elenacuoco",
      "author_url": "",
      "post_date": "08/15/2015 15:11:00",
      "content": "<p>Tim, one more question. Did you get same good results for LB score, if apply the correct procedure for resampling the signal? \nI'm still wondering how this can affect the score. You are training on a downsampled signal (that means, aliasing or not, you are looking ad different frequency from the orginal one), but then you predict on a signal which is not resampled...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 89446,
      "author_name": "bitsofbits",
      "author_url": "",
      "post_date": "08/15/2015 16:25:36",
      "content": "<p>Elena, I'm sorry, but I don't actually know how filtering or not affects things. All of my submission from home have been filtered before submitting. I have done some submissions from Kaggle scripts without filtering, but they have been smaller nets and not really comparable.  As for you second question, I train and predict on a resampled signal so it shouldn't be a problem (or at least not any more of an issue than downsampling in general). That is, when both training and testing, I use every nth point, starting with the most recent and going backwards in time.  I also filter both the test and training data in the same way, using a causal filter so I don't run afoul of the rule against future data.  This introduces a small lag from the filter, but that can't be helped.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 89448,
      "author_name": "elenacuoco",
      "author_url": "",
      "post_date": "08/15/2015 16:37:27",
      "content": "<p>Thanks Tim for your explanation!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "89186": "Hi, \r\nin most of the recent high score scripts is implemented a downsampling of the data, without a  low-pass filtering. Does this not introduce aliasing in the data? \r\nAre the result correct if we do downsampling in this way?",
    "89249": "The answer to your first question is yes.  As for the second question, that seems more complicated.  My take is that features based on aliased data are still features, so if they work for predicting things, then they work. On the other hand, they probably aren't quite the feature that one thinks they are, which will make the model difficult to interpret. Also the high frequencies are likely full of noise, which won't be great for the model accuracy to the extent that it leaks in through aliasing.\r\n\r\nI'm guilty of ripping out the low pass filtering in my script when I posted it, since I could barely get it to meet timing before they upped the limit. So, I was trimming whatever I could. I should at least have left a comment in about how one should probably add filtering though. I'll go do that now.",
    "89275": "Thanks Tim. The point you wrote in the second part is important. Ok we can add any features to have better results, but is the model predicting what we want?\r\nThanks also for your good code. I learned a lot from it.",
    "89420": "You're welcome; I'm glad that code was helpful.\r\n\r\nAnd congrats on getting script of the week; that's great!",
    "89442": "Tim, one more question. Did you get same good results for LB score, if apply the correct procedure for resampling the signal? \r\nI'm still wondering how this can affect the score. You are training on a downsampled signal (that means, aliasing or not, you are looking ad different frequency from the orginal one), but then you predict on a signal which is not resampled...",
    "89446": "Elena, I'm sorry, but I don't actually know how filtering or not affects things. All of my submission from home have been filtered before submitting. I have done some submissions from Kaggle scripts without filtering, but they have been smaller nets and not really comparable.  As for you second question, I train and predict on a resampled signal so it shouldn't be a problem (or at least not any more of an issue than downsampling in general). That is, when both training and testing, I use every nth point, starting with the most recent and going backwards in time.  I also filter both the test and training data in the same way, using a causal filter so I don't run afoul of the rule against future data.  This introduces a small lag from the filter, but that can't be helped.",
    "89448": "Thanks Tim for your explanation!"
  },
  "source": "meta"
}