wvictor14 / team_Methylation-Badassays

STAT 540 Spring 2017 team repository
0 stars 2 forks source link

lecture 19 regularization code #7

Closed wvictor14 closed 7 years ago

wvictor14 commented 7 years ago

@singha53

Hey Amit, I ran your code to do the nested CV. See .md file here. It took about 5 hours to run. Would you mind taking a look at it? Scroll to the bottom.

A few questions:

Thanks for the talk yesterday, it was really helpful,

Victor

singha53-zz commented 7 years ago

Hi @wvictor14

the reason why it might be taking time is because ur dataset is very large (methylation data right?) one way to speed things up is to filter out genes with little variance (and keep say the top 5000?). remember you are interested in a biomarker panel of a few cpgs to predict response.

since your dataset is small dont have panels that are very large --> controlled by alpha. alpha =0 keep all genes to predict response. alpha = 1 --> least number of genes. in the lectures i used and alpha = 1 to get the smallest panel. (See lecture slides to determine how to extract cpgs in the panels)

play around with those two parameters and let me know how it goes. looks good so far! Best, A

wvictor14 commented 7 years ago

Hey, thanks for the advice.

If we wanted to do prefiltering, then we would need another layer of Cross validation for this right? I think you can use 'sbf()' and 'sbfcontrol' for this, like how you did in the code for testing knn model in lecture 19.

Victor

singha53-zz commented 7 years ago

@wvictor14 As Rob said. pre-filtering is done independent of class labels (see snippet from lecture notes): image

The filter I did using sbf is called feature selection using univariate filtering where the class labels are used. I used this for knn which does not perform feature selection unlike glmnet. This is ofcourse performed with cross-validation. Therefore you can pre-filter (remove) cpgs without looking at the class labels of samples (e.g. variance across all samples). Let me know if this makes sense.

wvictor14 commented 7 years ago

Yup the prefiltering stuff makes sense. Thanks!