Skip to content

textmodel_lsa does not weigth correctly the v singular vectors with the singular values? #64

@JFChartier

Description

@JFChartier

Hello,

I think there is an error in the way the LSA is computed in textmodel_lsa.R. After the svd decomposition, the v singular vectors are usually weighed with the k remaining singular values. However, at line 80 the matrix v is multiplied column-wise with d instead of row-wise. See :

result$matrix_low_rank <- t(dec$v * dec$d)

If I'm not wrong, the correct way to weight the v singular vectors should be v %*% diag(d) ?
This is how the weighing is calculated in the text2vec package. See:
https://github.com/dselivanov/text2vec/blob/e3b9865057ba8dae713badbf71ca5160b7a6efa6/R/model_LSA.R#L76

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions