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

Passing perplexity_list in R? #100

Open
hummuscience opened this issue May 5, 2020 · 1 comment
Open

Passing perplexity_list in R? #100

hummuscience opened this issue May 5, 2020 · 1 comment

Comments

@hummuscience
Copy link

hummuscience commented May 5, 2020

It states that I should pass a list, which in R would be using list(). Additionally, it also states that perplexity should be set to 0 to use this option

#       perplexity_list - if perplexity==0 then perplexity combination will
#            be used with values taken from perplexity_list. Default: NULL
#       df - Degree of freedom of t-distribution, must be greater than 0.
#       Values smaller than 1 correspond to heavier tails, which can often 
#       resolve substructure in the embedding. See Kobak et al. (2019) for
#       details. Default is 1.0

So I ended up trying the following:
n-cells is 50k

testinglist <- fftRtsne(X = t(scaled.counts),
                        perplexity = 0,
                        perplexity_list = list(30,ncol(scaled.counts)/100),
                        learning_rate = ncol(scaled.counts)/12)

This however gives the following error:
Error in max(perplexity_list) : invalid 'type' (list) of argument

This is happening at this line:
search_k <- n_trees * max(perplexity_list) * 3

Running max(list(30,505)) gives that same error. However, running length(list(30,505)) outputs 2 so I am guessing that maybe in R it is not meant to be a list but a vector instead? Since both max and length would work then. The only question would be anything afterwards depends on perplexity_list being a list and not a vector since indexing a list is different than a vector.

Additionally it would be good to have some verbose output letting the use know that multiple perplexities are being used.

@gamanakis
Copy link

Could you try with:

perplexity_list = c(30,ncol(drg.integrated)/100)

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

No branches or pull requests

2 participants