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

Problem with regression #1

Open
vadimverenich opened this issue Feb 10, 2021 · 6 comments
Open

Problem with regression #1

vadimverenich opened this issue Feb 10, 2021 · 6 comments

Comments

@vadimverenich
Copy link

I have recently discovered problem running Ancestry_Inference R code

Rscript Ancestry_Inference.R input/examplepc.txt input/example_popref.txt prefix
Error in { :
task 1 failed - "Need numeric dependent variable for regression."
Calls: %dopar% ->
Execution halted

@shafiqnoa
Copy link

Hi vadiverenich,
Have you solved the issue? I get the same error.
Please let me know if you have a solution for this.

@liutiming
Copy link

I think the issue here is that y in the svm formula is character type. The formula is defined by svm.mod <- as.formula(paste0("Population~", paste0("PC", 1:numpc, collapse = "+"))) and used in the following two lines:

mod.svm <- svm(svm.mod, data = dat[dat$fold != fold.index, ], kernel = "radial",

and

mod_svm <- svm(formula = svm.mod, data = dat[index, ], kernel = "radial", gamma = 10^best.set[1],

Thus, I suspect the problem can be partially resolved by set Population as a factor/numeric in dat before the svm step.

However, as I did so, the results of a largely European group now has largely AMR inferences, so I suspect there are some factor levels issue as the inference results are converted back to the population group. In any case, I will contact the project lead regarding this, and the script I have edited is https://gist.github.com/liutiming/8723973ecd0ef2d8fc9245e10fee5324

Thanks to @pontikos for helping with the debugging.

@mhelena
Copy link

mhelena commented Sep 15, 2022

Thank you @liutiming. I am using your edited script. It works well, but I am getting a lot of AFR inferences.
Did you find out why that is happening?

Thanks!

@alanmejiamaza
Copy link

Hi,

Thanks for correcting the script.
were any of you able to determine why AFR inferences are showing up at high levels? My SNP dataset are supposed to be south east Asians mostly but AFR shows up in a high %.
Any idea?
Thanks

@VasiliosRaptis
Copy link

Hello,

I had the same problem when running on R 4.2. It worked on R version 3.6.

@finkbine
Copy link

finkbine commented Feb 7, 2024

Hi,
Just confirm that R 3.6 works well, I have to install the old R 3.6 on windows. VasiliosRaptis, 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

7 participants