Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to select the optimum number of dimensions after applying LSA in R

$
0
0

@pagal_guy wrote:

Hello,

I am trying to use lsa for document classification.I want to be able to extract the appropriate number of dimensions from the matrix after LSA as we do in PCA.

Here is what I am doing:

library(lsa)
lsa.model <- lsa(dtm)
summary(lsa.model)
summary.textmatrix(as.textmatrix(lsa.model))
dk_matrix <- data.frame(data.matrix(lsa.model$dk))

# specific share of 0.9
dimcalc_share(share=0.8)(lsa.model$sk)
#This tells us to take 77 eigen vectors from dk matrix:
dk_matrix = dk_matrix[1:77]

Can someone pleas help me on whether this is right way or not??

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles