-
Notifications
You must be signed in to change notification settings - Fork 14
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
Merge fit()
and fit_dataset()
. Replace summary()
with transform()
. Add fit_transform()
.
#112
base: master
Are you sure you want to change the base?
Conversation
fit()
and fit_dataset()
. Replace summary()
with transform()
. Add fit_transform()
.fit()
and fit_dataset()
. Replace summary()
with transform()
. Add fit_transform()
.
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 totally forgot about this PR. Sorry about that!
@@ -112,9 +112,9 @@ class StoufferCombinationTest(CombinationTest): | |||
# Maps Dataset attributes onto fit() args; see BaseEstimator for details. | |||
_dataset_attr_map = {"z": "y", "w": "v"} | |||
|
|||
def fit(self, z, w=None): | |||
def _fit(self, z, w=None): |
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.
Why make this private?
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.
Yeah, this one was tricky because fit()
alone only works with datasets while _fit()
is fitted to arrays. This was a solution that worked, but I'm sure there is a more elegant one that can make that distinction clearer.
Would you suggest a different approach? Thanks!
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.
To be honest, I don't remember if I had considered how fitting to arrays would work with the proposed changes... I wish I'd made a note about it in #103.
We don't want users to call a private method, so I think the options are to either make the array-fitting method a different public method (e.g., fit_array
) or to support arrays in fit
. WDYT?
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 think if fit()
alone cannot distinguish between an array or dataset we should keep fit()
only for arrays for the sake of scikit-learn styling, and fit_dataset()
for datasets.
Does that mean we need to add fit_dataset_transform()
in addition to fit_transform()
?
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 think we want the Dataset to be the default (unless I'm misremembering), so I think fit_array
and fit
would be better than fit
and fit_dataset
. It's a difficult thing though, so maybe we should bring in the rest of the neurostore team on this?
Closes #103.
Changes proposed in this pull request:
fit()
andfit_dataset()
in BaseEstimator.fit_transform()
in BaseEstimator, to fit and transform data in one step.fit()
to_fit()
for all estimators.test_estimator_fit_transform
.