Note that there are some explanatory texts on larger screens.

plurals
  1. POFeature selection using the penalizedLDA package
    primarykey
    data
    text
    <p>I am trying to use the penalizedLDA package to run a penalized linear discriminant analysis in order to select the "most meaningful" variables. I have searched here and on other sites for help in accessing the the output from the penalized model to no avail. </p> <p>My data comprises of 400 varaibles and 44 groups. Code I used and results I got thus far:</p> <pre><code>yy.m&lt;-as.matrix(yy) #Factors/groups xx.m&lt;-as.matrix(xx) #Variables cv.out&lt;-PenalizedLDA.cv(xx.m,yy.m,type="standard") ## aplly the penalty out &lt;- PenalizedLDA(xx.m,yy.m,lambda=cv.out$bestlambda,K=cv.out$bestK) </code></pre> <p>Too get the structure of the output from the anaylsis:</p> <pre><code>&gt; str(out) List of 10 $ discrim: num [1:401, 1:4] -0.0234 -0.0219 -0.0189 -0.0143 -0.0102 ... $ xproj : num [1:100, 1:4] -8.31 -14.68 -11.07 -13.46 -26.2 ... $ K : int 4 $ crits :List of 4 ..$ : num [1:4] 2827 2827 2827 2827 ..$ : num [1:4] 914 914 914 914 ..$ : num [1:4] 162 162 162 162 ..$ : num [1:4] 48.6 48.6 48.6 48.6 $ type : chr "standard" $ lambda : num 0 $ lambda2: NULL $ wcsd.x : Named num [1:401] 0.0379 0.0335 0.0292 0.0261 0.0217 ... ..- attr(*, "names")= chr [1:401] "R400" "R405" "R410" "R415" ... $ x : num [1:100, 1:401] 0.147 0.144 0.145 0.141 0.129 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : NULL .. ..$ : chr [1:401] "R400" "R405" "R410" "R415" ... $ y : num [1:100, 1] 2 2 2 2 2 1 1 1 1 1 ... - attr(*, "class")= chr "penlda" </code></pre> <p>I am interested in obtaining a list or matrix of the top 20 variables for feature selection, more than likely based on the coefficients of the Linear discrimination. I realized I would have to sort the coefficients in descending order, and get the variable names matched to it. So the output I would expect is something like this imaginary example </p> <pre><code> V1 V2 R400 0.34 R1535 0.22... </code></pre> <p>Can anyone provide any pointers (not necessarily the R code). Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload