-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
context("HLLE") | ||
|
||
test_that("HLLE", { | ||
expect_error(embed(iris[1:4], "HLLE", ndim = 1, .mute = c("message", "output")), | ||
"ndim must be 2 or larger.") | ||
}) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
context("DiffusionMaps") | ||
|
||
test_that("DiffusionMaps", { | ||
expect_s4_class(embed(iris[1:4], "DiffusionMaps", ndim = 1, | ||
.mute = c("message", "output")), | ||
"dimRedResult") | ||
x <- embed(iris[1:4], "DiffusionMaps", ndim = 1, | ||
.mute = c("message", "output")) | ||
expect_equal(dim(x@data@data), c(150, 1)) | ||
}) |
fbd7bbf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fixes!
Couple quick side notes:
You may have already been bitten by this in R, but it's sometimes helpful to include a
drop=FALSE
arg when sub-setting matrices or dataframe columns in cases where it is possible that only one column will be selected. This ensures that an m x 1 matrix/dataframe is returned instead of a vector. E.g. compareiris[, 4]
andiris[, 4, drop = FALSE]
.Do you have any desire / plans to extend
dimRed
to include other methods in the future? (Other PCA/CCA variants, UMAP, tensor decomp methods, etc. come to mind..) If so, what kind of scope do you have in mind? Perhaps I could start a list somewhere of other methods that are already implemented in R that could be interested to eventually include, and If I have some time down the road, I can try and implement some of them.fbd7bbf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To 1) yes I already was and I (and the creators of R) think that this is a terrible default. Thanks for reminding me.
To 2) I currently have a fixed interface that maps a matrix (obs x dims) to a matrix (obs x embedding dims).
If you find more methods to wrap or implement, feel free to propose them in #4. Currently I don't have a lot of time to dedicate to this, so I don't want to make to many promises.
PRs are always welcome!
fbd7bbf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! The two PCA variants that come to mind are sparse and robust PCA. I'll add them to #4, and if I have the time and it seems useful, perhaps I'll submit a PR at some point.
Thanks for the quick fixes with the n=1 issues!