Skip to content

Reuse the precomputed spatial clustering - #30

Open
rcannood wants to merge 2 commits into
mainfrom
fix/reuse-spatial-clustering
Open

Reuse the precomputed spatial clustering#30
rcannood wants to merge 2 commits into
mainfrom
fix/reuse-spatial-clustering

Conversation

@rcannood

Copy link
Copy Markdown
Member

downstream threw away the spatial_cluster that process_datasets/generate_sim_spatialcluster had just computed and ran BayesSpace::spatialCluster() again. It is stochastic and unseeded, so the two runs disagree.

That shows up on the positive control, whose "simulated" dataset is the real dataset and which should therefore score 1: clustering_ari averages 0.55, with a per-dataset spread of 0.14 to 0.92, while the best simulator averages 0.22. The metric was measuring its own noise more than it was measuring the simulators.

It now reads the column that was already computed, and errors out with a clear message if it is missing. That also saves a BayesSpace MCMC run per method per dataset.

reclassify_simsce() was being called there too, but its result was never used -- ARI and NMI do not care about label permutations -- so that call goes as well. The function itself stays; generate_sim_spatialcluster still uses it.

Changes published numbers for clustering_ari and clustering_nmi.

Checklist before requesting a review

  • I have performed a self-review of my code

  • Check the correct box. Does this PR contain:

    • Breaking changes
    • New functionality
    • Major changes
    • Minor changes
    • Bug fixes
  • Proposed changes are described in the CHANGELOG.md

  • CI Tests succeed and look good!

rcannood added 2 commits July 28, 2026 14:23
`downstream` threw away the `spatial_cluster` that
process_datasets/generate_sim_spatialcluster had just computed and ran
BayesSpace again. BayesSpace is stochastic and unseeded, so the two runs
disagree: on the positive control clustering_ari averages 0.55 with a
per-dataset range of 0.14-0.92, while the best simulator averages 0.22. The
metric was measuring its own noise more than the simulators.

`reclassify_simsce()` was called but its result never used -- ARI and NMI do
not care about label permutations -- so that call goes as well.
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.

1 participant