feat: add avg classifier probability to unit_descriptor table#761
feat: add avg classifier probability to unit_descriptor table#761abuzarmahmood wants to merge 3 commits into
Conversation
When the waveform classifier is used, compute the average classifier probability for each sorted unit's waveforms and store it in both the per-unit metadata and the unit_descriptor table. - Add avg_classifier_prob column to sorted_unit_metadata and unit_descriptor - Pass avg classifier prob through save_unit in both auto and manual paths - Return subcluster_prob from auto_process_electrode - Load clf_prob/clf_pred in manual post-processing when available - Display classifier probability in unit summary plots Closes #760 Co-authored-by: Ona <no-reply@ona.com>
for more information, see https://pre-commit.ci
Solution SummaryThis PR adds How it worksData flow: During spike sorting, the classifier produces a probability for each waveform indicating confidence that it's a real spike (stored in Files changed
Backward compatibility
|
| print('Fix the issue and try again. Skipping this electrode.') | ||
| continue | ||
|
|
||
| # Load classifier probabilities if available |
There was a problem hiding this comment.
@copilot is clf prob loaded anywhere else? make sure this is not redundant code. If it is, try to simplify / refactor to avoid redundancy
|
@abuzarmahmood I've opened a new pull request, #768, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
When the waveform classifier is used, the average classifier probability of each sorted unit's waveforms is now stored in the
unit_descriptortable. This gives a per-unit quality signal based on how confidently the classifier identified the waveforms as spikes.\n\n## Changes\n\n- Addavg_classifier_prob(Float32) column tosorted_unit_metadataandunit_descriptortable definitions\n-save_unitaccepts an optionalavg_classifier_probparameter (defaults to NaN when classifier is not used)\n- Auto-processing path:auto_process_electrodenow returnssubcluster_prob; the caller computesnp.mean(subcluster_prob[i])for each accepted unit\n- Manual processing path: loadsclf_prob.npy/clf_pred.npyfor the electrode when available, computes avg prob over the selected spike indices\n- Unit summary plots (blech_units_plot.py) display the classifier probability when present\n\nCloses #760