LorenFrankLab / non_local_detector

MIT License
1 stars 1 forks source link

`NonLocalSortedSpikesDetector` issue #4

Open khl02007 opened 6 days ago

khl02007 commented 6 days ago

I'm getting very different results with NonLocalSortedSpikesDetector vs. what I used to get with the older package.

classifier_ca1 = non_local_detector.NonLocalSortedSpikesDetector()

classifier_ca1.fit(
    position_time=t_position,
    position=position,
    spike_times=spike_times,)

results_ca1 = classifier_ca1.predict(
    position_time=t_position,
    position=position,
    spike_times=spike_times,
    time=time,
)
non_local_detector.visualization.figurl_2D.create_interactive_2D_decoding_figurl(position_time=time,
                                                                                 position=position_interp,
                                                                                 env=classifier_ca1.environments[0],
                                                                                 results=results,
                                                                                 spike_times=spike_times,
                                                                                 head_dir=head_direction_interp
                                                                                 )

from non_local_detector https://figurl.org/f?v=npm://@fi-sci/figurl-sortingview@12/dist&d=sha1://4283c2e1714a1a8f6a4fd23fc2584b1db5566d9a&label=2D%20Decoding&zone=franklab.default

from replay_trajectory_classification https://figurl.org/f?v=npm://@fi-sci/figurl-sortingview@12/dist&d=sha1://427b590e8c751a475f4043a194c5b56beb802b6a&label=test&zone=franklab.default

It could be an issue with the visualization. Is there any other way I can compare the two results other than with figurl?

edeno commented 6 days ago

They are two different models. It is probably a matter of how the posterior is being displayed in the figurl. You're basically only seeing the non-local stuff in the posterior.

khl02007 commented 6 days ago

I see, I tried to do results_ca1.sum("state").acausal_posterior, which works for the old package but not for the new one (it seems the structure of results is slightly different). As a result I couldn't pass posterior parameter to non_local_detector.visualization.figurl_2D.create_interactive_2D_decoding_figurl. Anyway just wanted to report that using the function in this way gives different results.