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

rasterPCA questions #64

Open
andliszmmu opened this issue Aug 8, 2020 · 0 comments
Open

rasterPCA questions #64

andliszmmu opened this issue Aug 8, 2020 · 0 comments

Comments

@andliszmmu
Copy link

I use rasterPCA with a set of 85 rasters of size 5703 x 2657. Well, rasterPCA takes days (or stops with 'cannot place vector of some Gb'), predict() was never finished yet due to memory consuming or other reasons. So, I never got result yet )))
I have two related questions. The first looks like a bug...
When I use rasterPCA(train.stack, nSamples = 10000, maskCheck=F, spca = T) - when I use nSamples = int - I noticed that this nSamples parameter does not work. I looked at the code and found that function uses random sample of size nSamples from rasters with na.rm = T option. However (I checked) na.rm = T does not take effect. My rasters have a lot of NA values. So if nSamples = 10000, real sample is about 100. Increasing nSamples I got a proportional increasing of random sample size. In my case, I got random sample of 10 000, when used nSamples = 3 000 000.

I tried to use parallel computing to increase calculation speed, but this attempt also failed )) Here is my code:
beginCluster(n=4)
train.pc <- rasterPCA(train.stack, nSamples = ns.pc, maskCheck=F, spca = T)
endCluster()
but during rasterPCA executing, I see that 1 core is loaded only. Was I wrong here?
Thank you

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

1 participant