Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

THINGS: model-tools - #70

Closed
linus-md wants to merge 41 commits into
brain-score:masterfrom
linus-md:master
Closed

linus-md wants to merge 41 commits into
brain-score:masterfrom
linus-md:master

Conversation

@linus-md

Copy link
Copy Markdown

Hello @mschrimpf,

I started implementing the task in the behavior.py file and I linked it to the init.py file.
I would be happy if you could have a look at it.

Best,
Linus

@linus-md linus-md changed the title add odd-one-out task to model-tools THINGS: model-tools Jul 12, 2023

@mschrimpf mschrimpf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes the skeleton looks good 👍

@linus-md

Copy link
Copy Markdown
Author

Do I need to make any more changes to model_tools/brain_transformation/behavior.py?

@mschrimpf mschrimpf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, see below for comments. If you can avoid positional indexing (e.g. features[0]), indexing via metadata is generally preferred (example in suggestions).

You should also add unit tests to make sure the code actually does what you expect. See https://github.com/brain-score/model-tools/blob/master/tests/brain_transformation/test_behavior.py#L47 for examples

@linus-md

linus-md commented Jul 13, 2023 •

Copy link
Copy Markdown
Author

@mschrimpf thank you for the input. I actually meant if there is anything left to do in model_tools/brain_transformation/__init__.py.

@mschrimpf

Copy link
Copy Markdown
Member

@mschrimpf thank you for the input. I actually meant if there is anything left to do in model_tools/brain_transformation/__init__.py.

no, I don't think so

@linus-md
linus-md marked this pull request as ready for review October 16, 2023 11:17
@linus-md
linus-md requested a review from mschrimpf October 16, 2023 13:22
return choices

def unique_stimuli(self, triplets):
"""Returns a dataframe with unique stimuli."""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numpy and pandas functions didn't work directly. Do you have any ideas here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by "didn't work directly"? np.unique should give you the unique stimulus ids.

I'm guessing you could just use triplets.drop_duplicates() (http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.drop_duplicates.html)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember exactly but there was an error like: ...Error: StimulusSet doesn't have ... unique. I will look at this again once we wrap up the data PR.

return choices

def unique_stimuli(self, triplets):
"""Returns a dataframe with unique stimuli."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by "didn't work directly"? np.unique should give you the unique stimulus ids.

I'm guessing you could just use triplets.drop_duplicates() (http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.drop_duplicates.html)

mschrimpf added a commit to linus-md/brain-score that referenced this pull request Jan 4, 2024
@linus-md linus-md closed this by deleting the head repository Jan 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants