Repository navigation
Cluster the projected data in SpectralBiclustering, and rank null vectors last - #515
Merged
Merged
Conversation
…tors last The test fixture has rank two, so four of the six singular vectors the fit asks for lie in the null space. The block power iteration returns rounding there, and what it returns depends on the BLAS. Where those vectors came back as zeros they scored a piecewise error of zero, outranked the vector that carries the checkerboard, and every row landed in one cluster. That is the failure on the Linux runner. On macOS the same fault shows at other shapes: 136 of 1083 two block fits with Accelerate, 82 with OpenBLAS. The fit now follows scikit-learn more closely. Left vectors are ranked against the row clusters and right vectors against the column clusters. Rows are clustered as the normalized data projected onto the kept right vectors, and columns as its transpose projected onto the kept left vectors, so a null vector contributes coordinates near zero. A vector whose singular value is below 0.0001 of the leading one is ranked after every real vector. The test sweeps 1083 rank two fixtures across shapes and block contrasts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What failed
Run all tests and examplesfails onmainin run 44425142857.tests/test_spectral_biclustering.flowreports that both row blocks and both column blocks landed in one cluster. It passes on macOS.Cause
The fixture has rank two.
spectral_biclustering_fitasks for six singular vectors, so four of them lie in the null space. The block power iteration returns rounding there, and the result depends on the BLAS. Where those vectors come back as zeros they score a piecewise error of zero and outrank the one vector that carries the checkerboard. Every point then has the same coordinates and k-means puts them in one cluster.The same fault is reachable on macOS at other shapes. Before this change, of 1083 two block fixtures (4 to 40 rows, 4 to 40 columns, three block contrasts):
Change
The fit now follows scikit-learn's
SpectralBiclusteringmore closely.Test
tests/test_spectral_biclustering.flowgains a sweep over the 1083 fixtures above.Toolchain is the pinned Flow commit
88aac509.Not verified locally
The x86-64 OpenBLAS build on the runner is the one that failed, and it was not available here. This PR's
Run all tests and examplesjob is the check for it.Left out
Two fixtures scikit-learn recovers still fail here: 12 by 3 with two column clusters, and 60 by 40 with four row clusters and three column clusters. Both come from
_bic_kmeansseeding its centres from evenly spaced points, which can pick two points from the same block. That is a separate fault from this one.