Skip to content

ransac return a lot more bad channels than matlab version #8

Closed

Description

@yjmantilla

Hi, I'm Yorguin I've been studying the prep code for some time now. I'm testing differences between matlab's results and the current pyprep implementation. I have noticed that when I run pyprep I get an unusually high number of bad channels and in particular for the ransac criteria. For example:

If we take the following raw file: https://dataverse.tdl.org/file.xhtml?fileId=37645&version=1.0 which correspond to a public dataset we get:

Interpolated Channels Matlab : [10, 41, 44, 50, 65] (0 index corrected)

Interpolated Channels Python: [11, 17, 46, 36, 65, 10, 52, 9, 6, 4, 57, 8, 29, 59, 12, 26, 18, 13, 58, 42, 35, 56, 61, 15, 43, 7, 51, 44, 62, 32, 41, 14, 20, 47]

I'm currently working on it and I think I have found the mistake (it is actually outside the ransac) so I made a fork where I will put the changes that I made. With the changes I implemented we get: [10,41,44,49, 50, 52 ,54, 65]

** This was done skipping the line noise multitaper notch (for both matlab and pyprep) because that took too long to run the tests...

Apart from this I was able to find out a way to make the ransac less memory hungry using either one of two methods:

  • Automatically calculate the resample rate needed for the ransac to fit into memory.
  • Calculate the ransac in a more channels wise manner.

There are also some little discrepancies in the logic of the Matlab PREP and in pyprep here and there. Particularly in performReference method.

I will be uploading those changes to the fork in a separated manner so it is easier to keep track of the changes.

Let me know what you think about all of this.

Activity

  1. sappelhoff commented on Mar 23, 2020

    @sappelhoff
    Owner

    Hi @yjmantilla thanks for this report! Once you are done pushing the changes to your fork, feel free to make a pull request here. We can integrate your fixes and make a new release of pyprep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions