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

fcm_compress drops class #728

Closed
kbenoit opened this issue May 10, 2017 · 0 comments
Closed

fcm_compress drops class #728

kbenoit opened this issue May 10, 2017 · 0 comments
Assignees
Labels

Comments

@kbenoit
Copy link
Collaborator

kbenoit commented May 10, 2017

myfcm <- fcm(tokens(c("b A A d", "C C a b B e")), context = "document")

# make some equivalent dimnames
myfcm@Dimnames[[1]] <- tolower(myfcm@Dimnames[[1]])

## this should not be possible, since an fcm needs to remain symmetric
fcm_compress(myfcm)
# 5 x 7 sparse Matrix of class "dgCMatrix"
#     features
# docs b A d C a B e
#    b 0 2 1 2 1 1 2
#    a . 1 2 . 0 1 1
#    d . . 0 . . . .
#    c . . . 1 2 2 2
#    e . . . . . . 0

## this should be possible, but should retain the fcm class and
## slots
myfcm@Dimnames[[2]] <- tolower(myfcm@Dimnames[[2]])
fcm_compress(myfcm)
# 5 x 5 sparse Matrix of class "dtCMatrix"
#     features
# docs b a d c e
#    b 1 3 1 2 2
#    a . 1 2 . 1
#    d . . 0 . .
#    c . . . 1 2
#    e . . . . 0
@kbenoit kbenoit added the bug label May 10, 2017
kbenoit added a commit that referenced this issue May 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants