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

dask sparse PCA dtype #3487

Open
3 tasks done
ilan-gold opened this issue Feb 26, 2025 · 0 comments
Open
3 tasks done

dask sparse PCA dtype #3487

ilan-gold opened this issue Feb 26, 2025 · 0 comments
Labels
Triage 🩺 This issue needs to be triaged by a maintainer

Comments

@ilan-gold
Copy link
Contributor

ilan-gold commented Feb 26, 2025

Please make sure these conditions are met

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of scanpy.
  • (optional) I have confirmed this bug exists on the main branch of scanpy.

What happened?

This isn't so much a bug as it doesn't have an impact on runtime behavior as a "we should be more careful because it could change" (dask ignores this when returning data and just returns the actually computed data, which is floating point)

return da.map_blocks(
transform_block,
x,
mean_=self.mean_,
components_=self.components_,
chunks=(x.chunks[0], self.n_components_),
meta=np.zeros([0], dtype=x.dtype),
dtype=x.dtype,
)

The output dtype of the PCA should be float, not that of the underlying data so we should likely add an argument or repurpose the dtype_ attribute to reflect this

This same issue is present in the covariance calculation

Minimal code sample

N/A

Error output

N/A

Versions

N/A

@ilan-gold ilan-gold added the Triage 🩺 This issue needs to be triaged by a maintainer label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage 🩺 This issue needs to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant