uwot icon indicating copy to clipboard operation
uwot copied to clipboard

`umap_transform` does not validate input sufficiently

Open jlmelville opened this issue 3 years ago • 2 comments

See https://github.com/satijalab/seurat/issues/4647 for an example.

jlmelville avatar Jun 27 '21 18:06 jlmelville

If it is helpful in any way, if prod(dim(X)) < 1, I can crash the R session consistently. I think it would be great if an error message pops up in this case instead of a session crash.

# Note: code crashes session. Execute with caution.
library(uwot)

model <- umap(iris, ret_model = TRUE)
trans <- umap_transform(iris[0, ], model = model)

teunbrand avatar Apr 13 '22 12:04 teunbrand

Thank you @teunbrand. The current version on github doesn't cause a session crash with this code, but the error message isn't very good so there is room for improvement here.

jlmelville avatar Apr 13 '22 15:04 jlmelville