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

Skip to content

[Closed] adding clusterQR to spectral clustering, and LOBPCG as an SVD solver to PCA and Truncated PCA #12291

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
wants to merge 19 commits into from

Conversation

lobpcg
Copy link
Contributor

@lobpcg lobpcg commented Oct 4, 2018

Reference Issues/PRs

Fixes #12164, #12079, #12080

What does this implement/fix? Explain your changes.

#12164 adds clusterQR method to 'kmeans' and 'discretize' in spectral clustering
#12079 adds LOBPCG as an SVD solver in PCA
#12080 adds LOBPCG solver to Truncated PCA

Any other comments?

Currently closed and moved to #12319

@lobpcg lobpcg changed the title adding clusterQR, and LOBPCG as an SVD solver in PCA and Truncated PCA adding clusterQR to spectral clustering, and LOBPCG as an SVD solver to PCA and Truncated PCA Oct 4, 2018
@sklearn-lgtm
Copy link

This pull request introduces 2 alerts when merging 73a54d0 into 877e3f3 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Module is imported with 'import' and 'import from'

Comment posted by LGTM.com

@lobpcg lobpcg closed this Oct 4, 2018
@lobpcg lobpcg reopened this Oct 5, 2018
@sklearn-lgtm
Copy link

This pull request introduces 1 alert when merging 2771657 into e6359e2 - view on LGTM.com

new alerts:

  • 1 for Mismatch in multiple assignment

Comment posted by LGTM.com

@lobpcg lobpcg closed this Oct 5, 2018
@lobpcg lobpcg reopened this Oct 5, 2018
@lobpcg
Copy link
Contributor Author

lobpcg commented Oct 5, 2018

I apologize for unintentionally putting 2 unrelated issues: clusterQR to spectral clustering, and LOBPCG as an SVD solver to PCA and Truncated PCA, in a single pull request. This is my first pull request :-)

I am also unsure if I follow the best or even proper practices and protocols, with multiple attempts, trying to clear all checks... I am open to good advice, please.

@ogrisel
Copy link
Member

ogrisel commented Oct 5, 2018

Could you please split this PR to have the contribution of the lobpcg_svd method along with it's use as an additional solver in PCA / TruncatedSVD and the clusterQR method in its own PR (possibly on top of the first one).

Also please add unittest tests for the lobpcg_svd method itself and extended the tests of the PCA and TruncatedSVD to also check for the use of this new method.

Finally, can you tell when is lobpcg_svd expected to perform better than the alternative methods? Would it make sense to update some of the existing examples of scikit-learn (in the examples/ folder) to demonstrate the practical benefits?

@lobpcg
Copy link
Contributor Author

lobpcg commented Oct 5, 2018

@ogrisel Thanks for your comment! Please see below:

Could you please split this PR to have the contribution of the lobpcg_svd method along with it's use as an additional solver in PCA / TruncatedSVD and the clusterQR method in its own PR (possibly on top of the first one).

How do I do it, technically speaking, please? I push my local changes to my fork, and then my pull request pull all the changes made...

Also please add unittest tests for the lobpcg_svd method itself and extended the tests of the PCA and TruncatedSVD to also check for the use of this new method.

I am working on it now, to be added here soon, after I fix all the current errors (only one left!)

Finally, can you tell when is lobpcg_svd expected to perform better than the alternative methods? Would it make sense to update some of the existing examples of scikit-learn (in the examples/ folder) to demonstrate the practical benefits?

I'll try. It may be not so easy, because the better performance is expected for large size cases. Do you know examples doing large-scale SVD?

@ogrisel
Copy link
Member

ogrisel commented Oct 5, 2018

git checkout -b clusterQR  # alias the current state of your local branch as a new branch for your clusterQR code and everything mixed in with it
git commit  # save any ongoing work in that branch to loose it
git checkout master
git fetch https://github.com/scikit-learn/scikit-learn.git master  # make sure you get up to date master
git reset --hard origin/master  # this will reset your local master to the state of the scikit-learn master to start clean
git checkout -b lobpcg-svd  # create a new local branch dedicated to lobpcg-svd
# report only the changes related to lobpcg to here (without anything related to clusterQR)
# add some tests
git commit  # note: please use a descriptive commit message
git push https://github.com/lobpcg/scikit-learn.git lobpcg-svd  # push your new branch to your fork
# create a new pull request from the  lobpcg-svd branch of your fork to the scikit-learn master branch

If you need you can always do git checkout clusterQR to switch back to your clusterQR branch.

If you need more help with git and github, please have a look at the online resources: https://help.github.com/articles/git-and-github-learning-resources/

@ogrisel
Copy link
Member

ogrisel commented Oct 5, 2018

I'll try. It may be not so easy, because the better performance is expected for large size cases. Do you know examples doing large-scale SVD?

It depends on what you call large scale. Anyway the examples should ideally take less than 30s to run because they are all executed each time we build the online documentation. Have a look at the existing examples:

git grep "PCA" examples/
git grep "TruncatedSVD" examples/

@lobpcg lobpcg closed this Oct 6, 2018
@lobpcg
Copy link
Contributor Author

lobpcg commented Oct 6, 2018

clusterQR method added to spectral segmentation in PR #12316

@lobpcg lobpcg changed the title adding clusterQR to spectral clustering, and LOBPCG as an SVD solver to PCA and Truncated PCA [Closed] adding clusterQR to spectral clustering, and LOBPCG as an SVD solver to PCA and Truncated PCA Oct 6, 2018
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

Successfully merging this pull request may close these issues.

new feature: add clusterQR method to 'kmeans' and 'discretize' in spectral clustering
3 participants