flatironinstitute / spikeforest_old

SpikeForest -- spike sorting analysis for website
Apache License 2.0
16 stars 8 forks source link

spikecomparison updates #77

Open samuelgarcia opened 4 years ago

samuelgarcia commented 4 years ago

Hi Jeremy, the refactoring of spikecomparison is now finished and tested. The new comaprison code should have now 2 modes for matching 'hungarian' and 'best' .

To have the same behavior as you had before in SF you can do something like that:

comp = compare_sorter_to_ground_truth(gt_sorting, tested_sorting,
                   delta_time=0.4, sampling_frequency=None,
                   min_accuracy=0.2, exhaustive_gt=True, match_mode='best', 
                   n_jobs=-1, compute_labels=False, verbose=False)
perf = comp.get_performance(method='by_unit')
print(perf.loc[:, ['accuracy', 'recall', 'precision'])

In your case, if you want to match even low agreeement you can put min_accuracy=0.2 the default is 0.5 in spikecomparison. The match_mode default is 'hungarian' so force 'best'.

Note that now labelling each spike is bypass always, so the computation should be faster. Tell if it is not the case.

Everything is in the master and Cole will release the package tomorow.

Samuel

magland commented 4 years ago

Great, thank you Samuel.

On Tuesday, October 1, 2019, Garcia Samuel notifications@github.com wrote:

Hi Jeremy, the refactoring of spikecomparison is now finished and tested. The new comaprison code should have now 2 modes for matching 'hungarian' and 'best' .

To have the same behavior as you had before in SF you can do something like that:

comp = compare_sorter_to_ground_truth(gt_sorting, tested_sorting, delta_time=0.4, sampling_frequency=None, min_accuracy=0.2, exhaustive_gt=True, match_mode='best', n_jobs=-1, compute_labels=False, verbose=False) perf = comp.get_performance(method='by_unit')print(perf.loc[:, ['accuracy', 'recall', 'precision'])

In your case, if you want to match even low agreeement you can put min_accuracy=0.2 the default is 0.5 in spikecomparison. The match_mode default is 'hungarian' so force 'best'.

Note that now labelling each spike is bypass always, so the computation should be faster. Tell if it is not the case.

Everything is in the master and Cole will release the package tomorow.

Samuel

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/flatironinstitute/spikeforest/issues/77?email_source=notifications&email_token=AA4CIQACWDMDMZLRK6LVNGLQML4SDA5CNFSM4I4FTT7KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HOYLEYQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AA4CIQAY6AUKU5EKNI6ADHDQML4SDANCNFSM4I4FTT7A .

-- Sent from my phone

samuelgarcia commented 4 years ago

Hi Jeremy finally a last minut change.

comp = compare_sorter_to_ground_truth(gt_sorting, tested_sorting,
                   delta_time=0.4, sampling_frequency=None,
                   match_score=0.5, chance_score=0.1, exhaustive_gt=True,
                   match_mode='best', n_jobs=-1, compute_labels=False, verbose=False)
perf = comp.get_performance(method='by_unit')
print(perf.loc[:, ['accuracy', 'recall', 'precision'])

match_score (def 0.5) is used for the hungarian and chance_score(def 0.1) is used for possible match and best match.

This more logic to separate the 2 case with 2 threshold. So for SF the only impaact is chance_score as long as you use match_mode='best'.

Don't fogot to play play exhaustive_gt=True/False. This do not impact performence tables.