-
Notifications
You must be signed in to change notification settings - Fork 149
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
ticket/PSB-70: Flipped running polarity for VBN behavior only sessions. #2667
Conversation
""" | ||
mean_speed = running_speed['speed'].mean() | ||
output_frame = running_speed.copy() | ||
if mean_speed < -1: |
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.
How was it decided that mean_speed < -1 indicates flipped polarity? Why not < 0?
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 have the same question. Seems like a negative average running speed is bad.
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.
This was proposed by the engineering group according to the issue. My assumption the value is -1 as you could have a case where a mouse is not running very much and the noise causes the mean to be below zero even fractionally. You can check out the plots of the mean histogram here. You can see a peak at just above zero with a slight tail to zero and lower values. @corbennett do you have any further context?
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.
ok, please link to that histogram in the code so it is clear why that value is hardcoded
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -63,6 +64,32 @@ def __init__( | |||
self._stimulus_timestamps = stimulus_timestamps | |||
self._filtered = filtered | |||
|
|||
@staticmethod | |||
def _check_running_speed(running_speed: pd.DataFrame) -> pd.DataFrame: |
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.
please name this something more specific like _fix_polarity
average speed is < -1 cm/s | ||
""" | ||
mean_speed = running_speed['speed'].mean() | ||
output_frame = running_speed.copy() |
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.
copying here not needed. You are modifying the dataframe.
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 mostly just end up being cautious about editing in place but you're right, I'll just edit and return the changed df.
""" | ||
mean_speed = running_speed['speed'].mean() | ||
output_frame = running_speed.copy() | ||
if mean_speed < -1: |
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 have the same question. Seems like a negative average running speed is bad.
8f4ef34
to
9662ae0
Compare
a0f6788
to
a7ca774
Compare
""" | ||
mean_speed = running_speed['speed'].mean() | ||
output_frame = running_speed.copy() | ||
if mean_speed < -1: |
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.
ok, please link to that histogram in the code so it is clear why that value is hardcoded
6728892
to
a6e9795
Compare
Add link to issue with histogram.
646cd39
to
a56d845
Compare
No description provided.