-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented sd_ratio
as quality metric
#2146
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@@ -1365,3 +1365,57 @@ def _compute_rp_violations_numba(nb_rp_violations, spike_trains, spike_clusters, | |||
spike_train = spike_trains[spike_clusters == i] | |||
n_v = _compute_nb_violations_numba(spike_train, t_r) | |||
nb_rp_violations[i] += n_v | |||
|
|||
|
|||
def compute_SD_test( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def compute_SD_test( | |
def compute_sd_ratio( |
I'm not super happy with the name. What abut sd_ratio
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm fine with that name!
sd_ratio
or std_ratio
?
sd_ratio
as quality metric
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is still in draft, but I tagged a couple notes. You can ignore and fix yourself if you want, but just wanted these on your radar.
@zm711 Thanks for the feedback! I'll make the changes after my lunch! |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Ok I like the state of the PR as it is now. A few things that are not perfect:
|
Could you also do a big favor with this PR and fix the order of |
warnings.warn( | ||
"The `sd_ratio` metric cannot work with a recordless WaveformExtractor object" | ||
"SD ratio metric will be set to NaN" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have to decide a global behavior for this. I would say lets raise no ?
spike_train = wvf_extractor.sorting.get_unit_spike_train(unit_id, segment_index=segment_index).astype( | ||
np.int64 | ||
) | ||
censored_indices = _find_duplicated_spikes_keep_first_iterative(spike_train, censored_period) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this is a good idea this cross dependency in this way between curation and qualitymetrics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you suggest as an alternative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's ok for now, but we can discuss higher-level hierarchy later
Hi Aurelien. |
Yes this is different than the 2002 paper (in multiple ways), but I still cited it because it was the first one to write down the idea. We can talk about it. I found this implementation easier, but you are right there may be more information available by using the whole waveform (although it makes drift correction and censored period trickier). |
The test is failing because of a bug that is solved by #2220 |
A "new" metric I've been working on.
I hope to implement it fast enough for it to be part of v0.99