zdebruine / RcppML

Rcpp Machine Learning: Fast robust NMF, divisive clustering, and more
GNU General Public License v2.0
89 stars 15 forks source link

R code example in the README is broken? #9

Closed tomsing1 closed 2 years ago

tomsing1 commented 2 years ago

I tried to run the R example code provided in the README page with RcppML 0.3.7 from CRAN, but ran into errors:

A <- Matrix::rsparsematrix(A, 1000, 1000, 0.1) # sparse Matrix::dgCMatrix
model <- RcppML::nmf(A, k = 10, nonneg = TRUE)
h0 <- RcppML::project(A, w = model$w)
RcppML::mse(A, m$w, m$d, m$h)

Maybe it should be this?

A <- Matrix::rsparsematrix(1000, 1000, 0.1) # sparse Matrix::dgCMatrix
model <- RcppML::nmf(A, k = 10, nonneg = TRUE)
h0 <- RcppML::project(A, w = t(model$w))
RcppML::mse(A, model$w, model$d, model$h)

Thanks for making this great R package available!

zdebruine commented 2 years ago

Thanks! Obviously broken indeed, and your fix does the magic.