Skip to content
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

FunctionTransformer with mrmr_regression & gridsearchCV Issue #18

Closed
calvs01 opened this issue Jun 29, 2022 · 1 comment
Closed

FunctionTransformer with mrmr_regression & gridsearchCV Issue #18

calvs01 opened this issue Jun 29, 2022 · 1 comment

Comments

@calvs01
Copy link

calvs01 commented Jun 29, 2022

Hello,

I attempted to use mrmr_regression in a pipeline with gridsearchCV to optimize the argument K as a hyperparameter and ran into the following issue:

I made a function that would return just dataframe with a sparse feature set.
Then, I used FunctionTransformer to convert this into a transformer to be used in a pipeline.
After adding some arbitrary sklearn model (sklearn.kernel_ridge.KernelRidge), to the pipeline and trying to use gridsearchCV, it returned the following error: 'numpy.ndarray' object has no attribute 'columns'. The same error came up when trying to call "pipe.fit()" without gridsearchCV.

I think this is referring to the fact that your function 'parallel_df' called in 'f_regression' uses df.columns, and gridsearch might be trying to feed it a 2d array. Do you have any suggestions on how to get around this issue?

Thank you very much

mrmr gridsearch issue

@calvs01
Copy link
Author

calvs01 commented Jun 29, 2022

Hello,

Nevermind the issue was simply the output of StandardScaler...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants