Model_based_curation + unitrefine prediction: add unit_ids input - #4716
Model_based_curation + unitrefine prediction: add unit_ids input#4716alejoe91 wants to merge 9 commits into
unit_ids input#4716Conversation
|
Alternatively, extend the |
unit_ids input
@samuelgarcia modified with your suggestion to optionally pass |
| self.required_metrics = pipeline.feature_names_in_ | ||
|
|
||
| def predict_labels( | ||
| self, label_conversion=None, input_data=None, export_to_phy=False, model_info=None, enforce_metric_params=False |
There was a problem hiding this comment.
Some of the tutorials on the UnitRefine page use the input_data to pass csvs.
So this might be used in people's code in the wild.
There was a problem hiding this comment.
actually, I think metrics is a better name. I'm adding input_data as and a deprecation warning.
| if self.sorting_analyzer is not None: | ||
| self.sorting_analyzer.set_sorting_property("classifier_label", predictions) | ||
| self.sorting_analyzer.set_sorting_property("classifier_probability", probabilities) |
There was a problem hiding this comment.
Just want to note that we do this for UnitRefine but not for Bombcell.
There was a problem hiding this comment.
now I added a set_predictions_as_properties argument to the predict_labels function and it is set to False by the unitrefine functions (so we don't have duplicated columns!)
…keinterface into model-prediction-avoit-copy
|
@chrishalcrow I modified the PR after Sam's suggestion. Instead of passing/analyzer or metrics, we can now optionally pass a subset of |
The current implementation of
unitrefinetakes aSortingAnalzyeras input, runs the noise/neural classifier, creates a newSortingAnalyzerwith neural units (withremove_units) and then runs the SUA/MUA classification.This PR allows to run the function (and the model based classificaiton), direclty from computed metrics, preventing the memory copy of the
remove_units.It also simplifies the implementation of some helper function and phy exporter in the
model_based_curation