Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Expose solver used with PCA(svd_solver='auto') #11223

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

Closed
rth opened this issue Jun 9, 2018 · 4 comments
Closed

Expose solver used with PCA(svd_solver='auto') #11223

rth opened this issue Jun 9, 2018 · 4 comments
Labels
Easy Well-defined and straightforward way to resolve good first issue Easy with clear instructions to resolve help wanted

Comments

@rth
Copy link
Member

rth commented Jun 9, 2018

When running PCA with svd_solver='auto' there is no way to know which solver was used in fit short of inspecting the logic in the code.

It would be helpful to have an easier way of inspecting the selected solver, the current situation makes debugging issues like #8236 harder.

For instance, NearestNeighbours also accepts the solver="auto" attribute, but in fit the actual solver used is stored in the _fit_method attribute (albeit private it is sufficient for debugging).

@qinhanmin2014
Copy link
Member

+1 to have a similar _fit_method parameter in PCA. I think we might even make it public.

@qinhanmin2014 qinhanmin2014 added Easy Well-defined and straightforward way to resolve good first issue Easy with clear instructions to resolve help wanted labels Jun 9, 2018
@njkevlani
Copy link
Contributor

@rth I'd be like to take it as my first issue.
Some questions:

  1. Should I keep "solver method name" variable private(_fit_method) or keep it public(Something else)?
  2. If private, should I code some method to get the name of method?
  3. Which is the file that include code for PCA?
  4. Any other suggestion you would like to provide.

@rth
Copy link
Member Author

rth commented Jun 9, 2018

Thanks for looking into it @njkevlani !

Should I keep "solver method name" variable private(_fit_method) or keep it public(Something else)?

I would think private, I'm not sure we want to have to maintain backward compatibility on this. Also this would be more consistent with NearestNeighbors.

If private, should I code some method to get the name of method?

IMO, just an attribute would be enough.

Which is the file that include code for PCA?

https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/decomposition/pca.py

@njkevlani
Copy link
Contributor

Thanks @rth for reply! Working on it, I'll open an PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Well-defined and straightforward way to resolve good first issue Easy with clear instructions to resolve help wanted
Projects
None yet
Development

No branches or pull requests

3 participants