renozao/NMF

Fixed basis example

Opened this issue · 2 comments

lima1 commented

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

Same question

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.