renozao / NMF

NMF: A Flexible R package for Nonnegative Matrix Factorization
139 stars 41 forks source link

Fixed basis example #142

Open lima1 opened 5 years ago

lima1 commented 5 years ago

Hi,

I'm struggling with fixing a basis. NMF tells me that the basis was not fixed and the method might not support it. But it I cannot get any method to work.

Here my attempt:

data(esGolub)
res <- nmf(esGolub, 3)
b <- basis(res)
bb <- apply(b, 2, function(x) pmax(0, jitter(x)))
rownames(bb) <- rownames(b)
nm <- nmfModel(esGolub ~ bb)
coef(nm) <- coef(res)
all <- lapply(nmfAlgorithm(), function(x) 
    try(nmf(esGolub, seed = nm, method = x)))
idx <- sapply(all, class) == "NMFfit"
sapply(all[idx], NMF:::.checkResult, nm)
[1] TRUE TRUE TRUE TRUE TRUE TRUE
Warning messages:
1: In FUN(X[[i]], ...) :
  nmf - Fixed basis terms were not all conserved in the fit: the method might not support them.
2: In FUN(X[[i]], ...) :
  nmf - Fixed basis terms were not all conserved in the fit: the method might not support them.
3: In FUN(X[[i]], ...) :
  nmf - Fixed basis terms were not all conserved in the fit: the method might not support them.
4: In FUN(X[[i]], ...) :
  nmf - Fixed basis terms were not all conserved in the fit: the method might not support them.
5: In FUN(X[[i]], ...) :
  nmf - Fixed basis terms were not all conserved in the fit: the method might not support them.
6: In FUN(X[[i]], ...) :
  nmf - Fixed basis terms were not all conserved in the fit: the method might not support them.

Thanks in advance, Markus

teng-gao commented 10 months ago

Same question

TingyanCN commented 6 months ago

The same questions. And I found that the basis which refered to fix is still change after nmf , but it's a little diffilcult to read C code to find out what happened.